Skip to content

The agent that grows with you

refactor(agent/codex_runtime): keep separate anchor-reset statements (source-inspection tests pin them)

Tekniumbecdbd3f42f1
diff --git a/agent/codex_runtime.py b/agent/codex_runtime.py
index 91a12afda19..fb136e7c682 100644
--- a/agent/codex_runtime.py
+++ b/agent/codex_runtime.py
@@ -150,7 +150,8 @@ def _record_codex_app_server_compaction(agent, turn, *, approx_tokens: int | Non
compressor.last_prompt_tokens, compressor.last_completion_tokens = -1, 0
compressor.awaiting_real_usage_after_compression = True
# Provider-side context was rewritten; the usage anchor's transcript snapshot no longer matches.
- agent._usage_anchor = agent._turn_base_usage_anchor = None
+ agent._usage_anchor = None
+ agent._turn_base_usage_anchor = None
agent._last_compaction_in_place = False
_call_guarded(getattr(agent, "event_callback", None) or None, "event_callback error on codex session:compress",
args=("session:compress", {