Skip to content

[Windows][Regression] Context compaction loses task state, repeats completed work, and exhausts weekly usage #35935

Description

@Lexoid2

What version of the Codex App are you using (From “About Codex” dialog)?

26.721.41059

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Microsoft Windows NT 10.0.19045.0 x64

What issue are you seeing?

Codex repeatedly loses or fails to restore the active execution state of a long-running software-development task after automatic context compaction.

I was using GPT-5.6 Sol in Ultra reasoning mode with subagents enabled. During execution, the main agent and its subagents made substantial and observable progress toward completing the task. Codex inspected the relevant source files, modified the code, built the application, ran verification steps, and repeatedly reached what appeared to be the post-build testing or final-reporting stage.

However, after automatic context compaction, the agent began behaving as though a significant part of the completed work and current task state was no longer available.

It returned to earlier stages of the task, reread files that had already been analyzed, reran commands that had already completed, reopened implementation questions that had already been resolved, and repeated work previously performed by the main agent or its subagents.

The session repeatedly entered the following loop:

substantial progress → near completion → automatic context compaction → loss of active task state → repetition of completed work → another context compaction

The agent sometimes reformulated its reasoning differently, but functionally returned to the same earlier work instead of continuing from the latest valid checkpoint.

This continued for approximately two hours. The task was never completed, despite Codex reaching the build, post-build verification, or final-reporting stage several times.

Before the affected execution, my included weekly Codex usage allowance was approximately 100%. After the repeated execution loop, the allowance had decreased to 0%, while the requested task remained unfinished.

This is not a complaint about the normal usage cost of GPT-5.6 Sol, Ultra reasoning, or subagents. I deliberately selected this configuration and understood that it would consume more usage.

The issue is that the allowance was consumed by repeated work following context-compaction events rather than by continued progress toward completion.

What steps can reproduce the bug?

  1. Open an existing local software project in Codex Desktop on Windows 10 x64.

  2. Select GPT-5.6 Sol.

  3. Select Ultra reasoning mode.

  4. Allow Codex to use subagents.

  5. Submit a multi-stage software-development task that requires:

    • repository analysis;
    • modification of existing source files;
    • coordination between the main agent and subagents;
    • building the application;
    • post-build testing or verification;
    • production of a final completion report.
  6. Allow Codex and its subagents to work until substantial progress has been made.

  7. Observe that Codex:

    • identifies the relevant files;
    • performs implementation work;
    • modifies the code;
    • builds the application;
    • runs tests or post-build checks;
    • approaches the final reporting stage.
  8. Wait for an automatic context-compaction event.

  9. Continue observing the agent after compaction.

  10. Instead of continuing from the latest valid execution checkpoint, Codex begins repeating earlier work. Typical behavior includes:

    • rereading files that were already inspected;
    • rerunning repository searches;
    • repeating diagnostic commands;
    • reconsidering implementation decisions already made;
    • reopening resolved problems;
    • repeating work completed by subagents;
    • returning from post-build verification to earlier repository analysis.
  11. Allow the session to continue.

  12. The repeated work consumes more context and causes another automatic context-compaction event.

  13. After the next compaction, Codex again returns to earlier work instead of completing the task.

  14. The cycle continues without a stable final result.

The problem reproduced repeatedly during attempts made on July 28–29, 2026.

Approximate execution pattern:

analysis → implementation → build → verification → near completion → context compaction → task-state regression → repeated analysis and implementation → another compaction

Observed usage impact:

  • Weekly allowance before the affected execution: approximately 100%.
  • Weekly allowance after approximately two hours: 0%.
  • Final task result: not delivered.
  • Exact token and context-window counters were not exposed in the desktop user interface.
  • The application displayed automatic context-compaction events during the affected execution.

The affected conversation was also submitted directly through the built-in Codex feedback function. The feedback interface did not display a session ID to me.

What is the expected behavior?

Automatic context compaction should preserve a structured and reliable continuation checkpoint.

After compaction, Codex should continue from the latest valid execution state instead of reconstructing the task from an incomplete general summary or returning to an earlier phase.

At minimum, the preserved state should include:

  • the exact current user request;
  • the task acceptance criteria;
  • the current execution phase;
  • work already completed;
  • work still remaining;
  • files already inspected;
  • files already modified;
  • commands already executed;
  • results of completed commands;
  • build results;
  • test and verification results;
  • implementation decisions already made;
  • issues already resolved;
  • known unresolved issues;
  • approaches already rejected;
  • relevant findings returned by subagents;
  • changes already completed by subagents;
  • the exact next action;
  • the explicit task-completion condition.

After context restoration, Codex should verify the current repository state and continue from the latest valid checkpoint.

It should not silently return to initial repository analysis, reopen resolved questions, or repeat completed commands and implementation work.

The runtime should also detect likely repetition loops, including:

  • repeated reading of the same files without a new reason;
  • repeated execution of the same searches or diagnostic commands;
  • repeated reconsideration of the same resolved issue;
  • repeated assignment of substantially identical work to subagents;
  • repeated builds without intervening code changes;
  • returning from final verification to initial analysis;
  • repeatedly approaching completion without producing the final response.

When reliable continuation is no longer possible, Codex should stop and explicitly report that state instead of indefinitely consuming the user’s limited usage allowance.

Additional information

Environment

  • Product: Codex Desktop for Windows
  • Installation source: Microsoft Store
  • Application version: 26.721.41059
  • Operating system: Windows 10 x64
  • Subscription: ChatGPT Plus
  • Model: GPT-5.6 Sol
  • Reasoning mode: Ultra
  • Subagents: Enabled
  • Dates observed: July 28–29, 2026
  • Time zone: Europe/Kyiv, UTC+3

Severity and impact

Severity: High

The issue caused:

  • failure to complete an otherwise finite software-development task;
  • repeated loss or weakening of the current execution state;
  • repetition of already completed work;
  • apparent loss or weakening of subagent findings;
  • repeated execution of commands and repository analysis;
  • exhaustion of the entire included weekly Codex usage allowance;
  • loss of approximately two hours of execution time;
  • inability to continue using the selected Codex configuration;
  • no completed final result.

This was not simply an incorrect answer or an unsuccessful implementation attempt.

The agent repeatedly reached the build, post-build verification, or final-reporting stage and then regressed after context compaction.

Regression information

This appears to be a regression.

I previously used Codex for comparable long-running software-development tasks. Automatic context compaction also occurred in earlier sessions, but it appeared less frequently and did not normally cause this degree of task-state regression.

Earlier sessions generally continued toward a logical completion after compaction. In the current behavior, compaction can cause the agent to return to substantially earlier stages and enter a non-terminating repetition loop.

Subagent-specific concern

Subagents were enabled during the affected execution.

Some work was completed or investigated by subagents, but after context compaction the parent agent sometimes behaved as though those findings or completed actions were no longer available.

Please investigate whether:

  • subagent outputs are fully retained across parent-context compaction;
  • completed subagent tasks remain marked as completed;
  • the parent agent can distinguish completed subagent work from pending work;
  • repository changes and conclusions produced by subagents survive compaction;
  • repeated compaction progressively weakens or removes subagent results.

Possible affected components

The exact root cause cannot be determined from the user interface.

The behavior appears correlated with automatic context compaction and may involve:

  • preservation of the active execution checkpoint;
  • restoration of the current task phase;
  • retention of completed and remaining work;
  • retention of subagent results;
  • synchronization between repository state and compacted conversation state;
  • loss of command, build, or test results;
  • repeated compaction of already compacted summaries;
  • loss of the latest task-completion condition;
  • absence of repetition-loop detection.

These are suspected affected areas, not confirmed root causes.

Requested investigation

Please investigate:

  1. Whether automatic context compaction preserves the latest active execution checkpoint.
  2. Whether the current task phase remains explicitly available after compaction.
  3. Whether completed work remains marked as completed.
  4. Whether command, build, and test results survive compaction.
  5. Whether subagent results remain available to the parent agent.
  6. Whether repeated compaction progressively removes important task state.
  7. Whether the restored state is synchronized with the actual repository state.
  8. Whether Codex can detect repeated post-compaction behavior.
  9. Whether the runtime can prevent non-terminating execution loops.
  10. Whether usage consumed during confirmed repetition loops can be identified in telemetry.

Reporting status

The affected conversation has already been submitted through the built-in Codex feedback function.

OpenAI Support has also been contacted regarding the account-level impact and the weekly allowance consumed during the failed execution.

Possible related reports include:

This report documents an independent reproduction involving Windows 10 x64, the Microsoft Store desktop application, ChatGPT Plus, GPT-5.6 Sol, Ultra reasoning mode, subagents, and complete exhaustion of the included weekly allowance.

Requested resolution

A complete resolution should include:

  • reliable preservation of structured task state before compaction;
  • restoration from the latest valid checkpoint;
  • retention of completed and remaining work;
  • retention of relevant subagent results;
  • synchronization with the actual repository and build state;
  • detection and prevention of repeated post-compaction execution;
  • a safe stop condition when reliable continuation is impossible;
  • protection against exhausting the user’s allowance through repeated completed work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingcontextIssues related to context management (including compaction)rate-limitsIssues related to rate limits, quotas, and token usage reportingsubagentIssues involving subagents or multi-agent featureswindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions