codex-agent-framework 0.1.18__tar.gz → 0.1.19__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (103) hide show
  1. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/CHANGELOG.md +9 -0
  2. {codex_agent_framework-0.1.18/codex_agent_framework.egg-info → codex_agent_framework-0.1.19}/PKG-INFO +4 -3
  3. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/README.md +3 -2
  4. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/sessions.py +2 -0
  5. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19/codex_agent_framework.egg-info}/PKG-INFO +4 -3
  6. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/pyproject.toml +1 -1
  7. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_agent.py +25 -5
  8. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/LICENSE +0 -0
  9. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/MANIFEST.in +0 -0
  10. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/__init__.py +0 -0
  11. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/__main__.py +0 -0
  12. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/agent.py +0 -0
  13. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/agent_runtime.py +0 -0
  14. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/ai.py +0 -0
  15. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/browser.py +0 -0
  16. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_commands.py +0 -0
  17. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_plugins/__init__.py +0 -0
  18. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_plugins/browser/__init__.py +0 -0
  19. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_plugins/desktop/__init__.py +0 -0
  20. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_plugins/memory/__init__.py +0 -0
  21. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_plugins/planner/__init__.py +0 -0
  22. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_plugins/scheduler/__init__.py +0 -0
  23. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_providers.py +0 -0
  24. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_tools/__init__.py +0 -0
  25. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_tools/files.py +0 -0
  26. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_tools/server_tools.py +0 -0
  27. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_tools/shell.py +0 -0
  28. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_tools/system.py +0 -0
  29. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/builtin_tools/vision.py +0 -0
  30. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/cli/__init__.py +0 -0
  31. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/cli/headless.py +0 -0
  32. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/cli/main.py +0 -0
  33. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/cli/output.py +0 -0
  34. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/cli/root.py +0 -0
  35. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/cli/runner.py +0 -0
  36. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/client.py +0 -0
  37. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/command.py +0 -0
  38. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/config.py +0 -0
  39. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/context.py +0 -0
  40. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/desktop.py +0 -0
  41. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/event.py +0 -0
  42. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/get_text/__init__.py +0 -0
  43. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/get_text/default_gitignore +0 -0
  44. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/get_text/get_text.py +0 -0
  45. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/get_text/simpler_get_text.py +0 -0
  46. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/hooks.py +0 -0
  47. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/image.py +0 -0
  48. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/latex.py +0 -0
  49. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/mainloop.py +0 -0
  50. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/message.py +0 -0
  51. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/plugin.py +0 -0
  52. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/prompts/image_generation_system_prompt.txt +0 -0
  53. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/prompts/system_prompt.txt +0 -0
  54. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/provider.py +0 -0
  55. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/registry.py +0 -0
  56. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/runtime.py +0 -0
  57. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/scheduler.py +0 -0
  58. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/scripts/install-system-dependencies.sh +0 -0
  59. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/server/__init__.py +0 -0
  60. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/server/app.py +0 -0
  61. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/server/core.py +0 -0
  62. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/service.py +0 -0
  63. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/status.py +0 -0
  64. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/stream_utils.py +0 -0
  65. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/tool.py +0 -0
  66. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/tray.py +0 -0
  67. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/tui/__init__.py +0 -0
  68. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/tui/chat.py +0 -0
  69. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/tui/lifecycle.py +0 -0
  70. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/utils.py +0 -0
  71. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/voice.py +0 -0
  72. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent/worker.py +0 -0
  73. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent_framework.egg-info/SOURCES.txt +0 -0
  74. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent_framework.egg-info/dependency_links.txt +0 -0
  75. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent_framework.egg-info/entry_points.txt +0 -0
  76. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent_framework.egg-info/requires.txt +0 -0
  77. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/codex_agent_framework.egg-info/top_level.txt +0 -0
  78. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/dependencies.txt +0 -0
  79. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/setup.cfg +0 -0
  80. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_agent_runtime.py +0 -0
  81. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_ai.py +0 -0
  82. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_browser.py +0 -0
  83. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_builtin_config.py +0 -0
  84. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_chat.py +0 -0
  85. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_cli.py +0 -0
  86. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_cli_headless.py +0 -0
  87. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_cli_root.py +0 -0
  88. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_client.py +0 -0
  89. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_events.py +0 -0
  90. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_get_text_browser.py +0 -0
  91. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_hooks.py +0 -0
  92. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_image_message.py +0 -0
  93. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_local_desktop.py +0 -0
  94. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_memory.py +0 -0
  95. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_messages.py +0 -0
  96. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_planner.py +0 -0
  97. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_scheduler.py +0 -0
  98. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_server.py +0 -0
  99. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_service.py +0 -0
  100. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_tray.py +0 -0
  101. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_tui.py +0 -0
  102. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_utils.py +0 -0
  103. {codex_agent_framework-0.1.18 → codex_agent_framework-0.1.19}/tests/test_worker.py +0 -0
@@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  This project loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and uses semantic versioning where practical.
6
6
 
7
+ ## [0.1.19] - 2026-05-08
8
+ ### Changed
9
+ - Compacting a session now purges compacted raw history from the active session file, keeping only the previous compaction anchor, the new compaction summary, and any unfinished remainder turn.
10
+ - Drop compaction summaries older than the latest anchor from active session files because each new compaction already incorporates the previous anchor.
11
+
12
+ ### Tests
13
+ - Add regression coverage for compaction prefix pruning, latest-anchor replay, older compaction removal, persisted session shape, and status/event message counts.
14
+ - Validate the full suite at 450 passing tests.
15
+
7
16
  ## [0.1.18] - 2026-05-08
8
17
  ### Added
9
18
  - Add generic plugin event and hook handler discovery so plugins can react to agent lifecycle events without hard-coded core coupling.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codex-agent-framework
3
- Version: 0.1.18
3
+ Version: 0.1.19
4
4
  Summary: A lightweight event-driven Codex agent runtime.
5
5
  Author: Baptiste
6
6
  License-Expression: MIT
@@ -638,10 +638,10 @@ python -m pyflakes codex_agent tests
638
638
 
639
639
  The tests isolate `AGENT_RUNTIME_DIR` automatically, so they should not create or resume sessions from your real `~/.agent_runtime`.
640
640
 
641
- The published `0.1.18` release was validated at:
641
+ The published `0.1.19` release was validated at:
642
642
 
643
643
  ```text
644
- 449 passed
644
+ 450 passed
645
645
  ```
646
646
 
647
647
  ## Packaging
@@ -659,6 +659,7 @@ The distribution includes prompt text files, `codex_agent/get_text/default_gitig
659
659
 
660
660
  ## Recent changes
661
661
 
662
+ - `0.1.19`: prune compacted raw session history after compaction, keep only the latest compaction anchor plus the new compaction and any unfinished remainder, and drop older redundant compaction summaries from active session files.
662
663
  - `0.1.18`: make `start server/tray` detach by default, move durable memory fully into the memory plugin, keep wakeups as a core runtime primitive, expose RAG memory timestamps/sources, and move browser/desktop backend controllers into core modules with plugins as facades.
663
664
  - `0.1.17`: reorganize the TUI and FastAPI server into dedicated `codex_agent.tui` and `codex_agent.server` packages, remove obsolete message payload fields, and clean unused imports.
664
665
  - `0.1.16`: tolerate missing OpenAI API keys at startup by disabling OpenAI-dependent voice and memory features, and skip memory archiving when the memory plugin is unavailable.
@@ -589,10 +589,10 @@ python -m pyflakes codex_agent tests
589
589
 
590
590
  The tests isolate `AGENT_RUNTIME_DIR` automatically, so they should not create or resume sessions from your real `~/.agent_runtime`.
591
591
 
592
- The published `0.1.18` release was validated at:
592
+ The published `0.1.19` release was validated at:
593
593
 
594
594
  ```text
595
- 449 passed
595
+ 450 passed
596
596
  ```
597
597
 
598
598
  ## Packaging
@@ -610,6 +610,7 @@ The distribution includes prompt text files, `codex_agent/get_text/default_gitig
610
610
 
611
611
  ## Recent changes
612
612
 
613
+ - `0.1.19`: prune compacted raw session history after compaction, keep only the latest compaction anchor plus the new compaction and any unfinished remainder, and drop older redundant compaction summaries from active session files.
613
614
  - `0.1.18`: make `start server/tray` detach by default, move durable memory fully into the memory plugin, keep wakeups as a core runtime primitive, expose RAG memory timestamps/sources, and move browser/desktop backend controllers into core modules with plugins as facades.
614
615
  - `0.1.17`: reorganize the TUI and FastAPI server into dedicated `codex_agent.tui` and `codex_agent.server` packages, remove obsolete message payload fields, and clean unused imports.
615
616
  - `0.1.16`: tolerate missing OpenAI API keys at startup by disabling OpenAI-dependent voice and memory features, and skip memory archiving when the memory plugin is unavailable.
@@ -73,6 +73,8 @@ class AgentSession(modict):
73
73
 
74
74
  insert_at = plan.start + len(compacted_messages)
75
75
  self.messages.insert(insert_at, message)
76
+ previous_anchor = [plan.anchor] if plan.anchor is not None else []
77
+ self.messages = previous_anchor + self.messages[insert_at:]
76
78
  self.save()
77
79
  return message
78
80
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codex-agent-framework
3
- Version: 0.1.18
3
+ Version: 0.1.19
4
4
  Summary: A lightweight event-driven Codex agent runtime.
5
5
  Author: Baptiste
6
6
  License-Expression: MIT
@@ -638,10 +638,10 @@ python -m pyflakes codex_agent tests
638
638
 
639
639
  The tests isolate `AGENT_RUNTIME_DIR` automatically, so they should not create or resume sessions from your real `~/.agent_runtime`.
640
640
 
641
- The published `0.1.18` release was validated at:
641
+ The published `0.1.19` release was validated at:
642
642
 
643
643
  ```text
644
- 449 passed
644
+ 450 passed
645
645
  ```
646
646
 
647
647
  ## Packaging
@@ -659,6 +659,7 @@ The distribution includes prompt text files, `codex_agent/get_text/default_gitig
659
659
 
660
660
  ## Recent changes
661
661
 
662
+ - `0.1.19`: prune compacted raw session history after compaction, keep only the latest compaction anchor plus the new compaction and any unfinished remainder, and drop older redundant compaction summaries from active session files.
662
663
  - `0.1.18`: make `start server/tray` detach by default, move durable memory fully into the memory plugin, keep wakeups as a core runtime primitive, expose RAG memory timestamps/sources, and move browser/desktop backend controllers into core modules with plugins as facades.
663
664
  - `0.1.17`: reorganize the TUI and FastAPI server into dedicated `codex_agent.tui` and `codex_agent.server` packages, remove obsolete message payload fields, and clean unused imports.
664
665
  - `0.1.16`: tolerate missing OpenAI API keys at startup by disabling OpenAI-dependent voice and memory features, and skip memory archiving when the memory plugin is unavailable.
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "codex-agent-framework"
7
- version = "0.1.18"
7
+ version = "0.1.19"
8
8
  description = "A lightweight event-driven Codex agent runtime."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"
@@ -341,7 +341,7 @@ def test_agent_interrupt_emits_request_event():
341
341
  assert agent.interrupt("api") is True
342
342
  assert seen == [("agent_interrupt_requested_event", "api", True)]
343
343
 
344
- def test_agent_session_compact_inserts_compaction_before_remainder(tmp_path, monkeypatch):
344
+ def test_agent_session_compact_purges_compacted_prefix_before_remainder(tmp_path, monkeypatch):
345
345
  monkeypatch.setattr(utils, "RUNTIME_DIR", str(tmp_path))
346
346
  user = DeveloperMessage(content="old session marker")
347
347
  done = AssistantMessage(content="done")
@@ -352,7 +352,8 @@ def test_agent_session_compact_inserts_compaction_before_remainder(tmp_path, mon
352
352
  message = session.compact(client=client)
353
353
 
354
354
  assert isinstance(message, CompactionMessage)
355
- assert session.messages == [user, done, message, current]
355
+ assert session.messages == [message, current]
356
+ assert [msg.id for msg in AgentSession.load(session.session_id).messages] == [message.id, current.id]
356
357
  assert "output_items" not in message
357
358
  assert message.summaries == [FakeCompactionResult.output_items[1]]
358
359
  assert message.compacted_message_count == 2
@@ -382,12 +383,31 @@ def test_agent_session_compact_starts_at_latest_compaction(tmp_path, monkeypatch
382
383
 
383
384
  message = session.compact(client=client)
384
385
 
385
- assert session.messages == [old_user, old_done, previous, new_user, new_done, message]
386
+ assert session.messages == [previous, message]
387
+ assert [msg.id for msg in AgentSession.load(session.session_id).messages] == [previous.id, message.id]
386
388
  assert client.history[0] == {"type": "compaction_summary", "id": "old"}
387
389
  assert "very old" not in json.dumps(client.history)
388
390
  assert "new done" in json.dumps(client.history)
389
391
 
390
392
 
393
+ def test_agent_session_compact_includes_only_latest_compaction_anchor(tmp_path, monkeypatch):
394
+ monkeypatch.setattr(utils, "RUNTIME_DIR", str(tmp_path))
395
+ older = CompactionMessage(output_items=[{"type": "compaction_summary", "id": "older"}])
396
+ latest = CompactionMessage(output_items=[{"type": "compaction_summary", "id": "latest"}])
397
+ new_user = DeveloperMessage(content="new facts")
398
+ new_done = AssistantMessage(content="new facts done")
399
+ session = AgentSession(messages=[older, latest, new_user, new_done])
400
+ client = FakeCompactionClient()
401
+
402
+ message = session.compact(client=client)
403
+
404
+ assert session.messages == [latest, message]
405
+ assert [msg.id for msg in AgentSession.load(session.session_id).messages] == [latest.id, message.id]
406
+ assert client.history[0] == {"type": "compaction_summary", "id": "latest"}
407
+ assert {item.get("id") for item in client.history if item.get("type") == "compaction_summary"} == {"latest"}
408
+ assert "new facts done" in json.dumps(client.history)
409
+
410
+
391
411
  def test_agent_compact_session_emits_volume_events(tmp_path, monkeypatch):
392
412
  monkeypatch.setattr(utils, "RUNTIME_DIR", str(tmp_path))
393
413
  agent = Agent(session="new", voice_enabled=False)
@@ -425,11 +445,11 @@ def test_agent_compact_session_emits_volume_events(tmp_path, monkeypatch):
425
445
  assert seen[1].status.context_current_tokens != 5000
426
446
  assert seen[1].compacted_message_count == 2
427
447
  assert seen[1].post_compaction_message_count == 2
428
- assert seen[1].total_session_messages == 4
448
+ assert seen[1].total_session_messages == 2
429
449
  status = agent.get_status()
430
450
  assert status.source == "local_estimate"
431
451
  assert status.sent_session_messages == 2
432
- assert status.total_session_messages == 4
452
+ assert status.total_session_messages == 2
433
453
  assert status.context_current_tokens != 5000
434
454
  assert status.quota_5h_percent == 12
435
455
  assert status.quota_7d_percent == 34