Repository navigation
Codex Desktop compaction requires unavailable notes tool, loses checkpoint, and repeats token-heavy work #42449
Description
What version of the Codex App are you using (From “About Codex” dialog)?
Codex Desktop; the About-dialog version is not exposed to the agent. The bundled CLI reports codex-cli 0.150.0-alpha.8.
What subscription do you have?
ChatGPT account-backed desktop session; the exact tier is not exposed to the agent.
What platform is your computer?
Darwin 25.6.0 arm64 arm
What issue are you seeing?
Codex Desktop injects a mandatory context-compaction protocol that requires the agent to write a checkpoint with a notes tool and recover it with history, but neither tool is present in the available tool surface. When the context is exhausted, the runtime still permits/requires new_context, so the active context is discarded without a checkpoint.
The next context receives no working summary. In this observed task, the agent fell back to reading the saved transcript, but large tool records were skipped or truncated. It therefore repeated GitHub issue and diff queries that it had already completed. Those repeated reads exhausted the next context within minutes and triggered the same loop again.
This is a deterministic mismatch between the runtime's injected compaction instructions and its provisioned tools, not merely imperfect summary quality. It wastes substantial tokens, repeats external operations, delays completion, and risks inconsistent conclusions.
What steps can reproduce the bug?
Observed thread: 01a05950-b653-7d11-a3cc-a7a9f518c2e2
- Start a long, tool-heavy task in Codex Desktop.
- Observe the injected context guidance telling the agent to use
notesfor checkpoints andhistoryafter compaction. - Inspect the available tools: there is no callable
notesorhistorytool. - Continue until the context limit is reached.
- The runtime instructs the agent to make exactly one
noteswrite and then callnew_context. - Because
notesis unavailable, the agent cannot create the required checkpoint, butnew_contextstill resets the context. - In the new context, observe that no checkpoint was injected. Any transcript fallback contains only a bounded/truncated view, so the agent repeats prior reads.
- Repeated reads consume the next context and reproduce the reset loop.
In the observed task this happened twice within roughly two minutes. Immediately before the first reset, the agent searched its full tool catalog for a notes capability and found none.
What is the expected behavior?
The compaction contract and tool surface must agree. At least one of these should hold:
notesandhistoryare always provisioned whenever the runtime instructs the agent to use them;- the runtime creates and injects an automatic durable checkpoint itself; or
new_contextfails closed when the required checkpoint was not successfully persisted.
A context reset must never silently discard active operational state and force repeated external reads.
Additional information
Related but broader continuity reports include #29356, #26354, and #37394. This report is narrower: it identifies the directly observable tool-contract mismatch and the resulting token-burning reset loop.
The repository-specific workaround should not be to build another compaction or transcript-recovery subsystem. This needs to be fixed in Codex's runtime/tool provisioning boundary.
Activity
oreasono commentedon Sep 8, 2026
A data point from the CLI side that may help whoever picks this up. The
notes/historytools the injected protocol refers to belong to the native history-notes extension, which core only installs whenuse_history_notes_extension && model_provider.is_openai() && current_auth_uses_codex_backend()all hold (ext/history-notes/src/extension.rs). When that extension is not active butfeatures.token_budgetis on, core falls back to an MCP server namednotes: it calls that server'sthread_hintat every window start and exposes the server's other tools to the model (core/src/session/mod.rs, "Keep the legacy bridge hint when native Notes is disabled"). So a session in this state can still get a realnotestool set by configuring[mcp_servers.notes].We built a server for exactly that fallback: https://github.com/oreasono/open-notes-mcp (Apache-2.0; notes are plain files,
INDEX.mdis injected into the next window). Caveats: I have not verified it against the Desktop's injected protocol text quoted here, and it providesnotes, nothistory— nothing in it searches earlier windows. Something to try, not the fix for the mismatch this issue is about.