Skip to content

Codex Desktop compaction requires unavailable notes tool, loses checkpoint, and repeats token-heavy work #42449

Open

Description

@robo-runner

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

  1. Start a long, tool-heavy task in Codex Desktop.
  2. Observe the injected context guidance telling the agent to use notes for checkpoints and history after compaction.
  3. Inspect the available tools: there is no callable notes or history tool.
  4. Continue until the context limit is reached.
  5. The runtime instructs the agent to make exactly one notes write and then call new_context.
  6. Because notes is unavailable, the agent cannot create the required checkpoint, but new_context still resets the context.
  7. 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.
  8. 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:

  • notes and history are always provisioned whenever the runtime instructs the agent to use them;
  • the runtime creates and injects an automatic durable checkpoint itself; or
  • new_context fails 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

  1. added
    bug
    app
    context
    tool-calls
    on Sep 3, 2026
  2. oreasono commented on Sep 8, 2026

    @oreasono

    A data point from the CLI side that may help whoever picks this up. The notes / history tools the injected protocol refers to belong to the native history-notes extension, which core only installs when use_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 but features.token_budget is on, core falls back to an MCP server named notes: it calls that server's thread_hint at 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 real notes tool 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.md is injected into the next window). Caveats: I have not verified it against the Desktop's injected protocol text quoted here, and it provides notes, not history — nothing in it searches earlier windows. Something to try, not the fix for the mismatch this issue is about.

  3. zhyuzhyu commented on Nov 3, 2026

    @zhyuzhyu

    Adding an independently observed macOS occurrence on November 3, 2026, with a related configuration/provisioning gap: token-budget rollover remained active even though the native Notes recovery path was unavailable for the configured provider. The agent then ended unfinished work with an AGENTS.md-only acknowledgement.

    Environment and configuration

    • macOS 26.6, arm64.
    • Installed desktop app: 26.1027.61615, build 24141; bundled codex-cli 0.166.0-alpha.5.1. These versions were read during the investigation, not independently established for every earlier boundary.
    • A third-party Responses provider; its name, endpoint and credentials are omitted.
    • The configured model alias was gpt-6.1-sol[1M]; the local catalog entry had no model_messages.token_budget object. This is a local alias/configuration observation, not a claim of supported experimental-context eligibility.
    • Before mitigation, codex features list reported token_budget = true and context_management = false. Activation came from the explicit manual configuration below, not the documented experimental-mode opt-in:
    [features.token_budget]
    enabled = true
    use_history_notes_extension = true

    Two observed lost-task continuations

    Both occurred in the same continuous chat. All timestamps are UTC on November 3, 2026:

    Context transition Turn completion Pending work
    06:28:56.580 06:29:08.875 Four substantive diagnostic questions were still unanswered.
    06:44:35.274 06:45:13.664 An explicitly requested issue report and configuration rollback had not been performed.

    In each occurrence, the final answer only acknowledged AGENTS.md constraints. It did not complete the pending work or report a recoverable handoff failure. There was no intervening human request to stop or replace the task. The user had to prompt the agent to continue.

    The complete serialized replacement_history type/role list at both boundaries was:

    [
      {"type": "message", "role": "developer"},
      {"type": "message", "role": "developer"},
      {"type": "message", "role": "user"}
    ]

    The sole user-role message contained AGENTS.md and environment context, not the active task. There was no assistant summary or compaction item. At both boundaries:

    message: ""
    compaction_response_id: null
    retained_context.user_messages: 8 entries
    retained_context.assistant_messages: 8 entries
    

    The original task remained readable through the saved local transcript and the desktop chat-history reader. This was not on-disk transcript deletion. No native Notes write/append call appeared before the affected rollovers; the exposed tool surface did not include the native Notes tools. The agent also failed to proactively recover the task through the available history reader after rollover.

    Source findings and evidence limits

    The inspected rust-v0.166.0-alpha.5.1 source provides a configuration-level explanation to investigate:

    • HistoryNotesExtension::update_config activates the native extension only when use_history_notes_extension, the OpenAI-provider check, and Codex-backend authentication all qualify. The inspected third-party-provider setup did not meet those conditions.
    • Token-budget compaction explicitly skips model/server summarization and starts a fresh context window.
    • Token-budget resolution falls back to the configured object when the catalog lacks model-owned token-budget defaults. The minimal configuration above did not supply handoff guidance, a reminder threshold or an auto-compaction fallback prompt.

    This is an observed task-continuity failure plus source-informed configuration analysis, not a deterministic minimal reproduction or a single-variable causal experiment. An empty message is intentional on the fresh-window path and is not, by itself, corruption. No native backend HTTP 404 is claimed here: unlike #43194, the relevant native extension was not provisioned for this setup. Related task-free-first-request report: #43335.

    Expected behavior and mitigation

    Please validate the recovery contract before accepting a summary-free rollover. If the required Notes/recovery capability is unavailable, warn or reject the incompatible manual opt-in, retain a minimal task checkpoint, or use a safe summarizing fallback. A regression test should cover unfinished task -> unavailable native Notes -> fresh-window transition -> rules-only final response/task_complete, including third-party providers and catalog entries without token-budget defaults.

    Locally, the manual nested block has been removed and token_budget = false explicitly set. A fresh CLI configuration read reports both token_budget and context_management false. This verifies the persisted mitigation, not an end-to-end fix or a reload of the already-running desktop chat.

    Private task contents, local paths, account/session identifiers, source code, credentials and raw transcripts are omitted. This is an AI-assisted report based on inspected local records.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugcontexttool-calls

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions