Repository navigation
[Context] Repeated auto-compaction degrades execution frontier and prevents convergence in long tasks #34095
Description
Description
In a long-running Codex Desktop task, automatic context compaction repeatedly preserved the broad objective but degraded the execution frontier: what was already complete, what remained, and the exact next action.
This was not a literal hard-amnesia reset. After compaction, the agent still referenced specific prior findings and files. The failure was loss of convergence: after many compactions it repeatedly announced variations of "finish the last items, run staged verification, then commit", reopened or rediscovered additional work, and did not reach the promised terminal state.
The original version of this report attributed the behavior directly to Ultra reasoning and claimed that only the base user prompt survived. The local rollout evidence does not support those stronger claims, so this report has been corrected to describe the observed behavior.
Environment
- Product: Codex Desktop
- Windows app version:
26.715.31925 - Bundled Codex/app-server version recorded in the rollout:
0.144.5 - Client/host topology: Windows client connected to a remote Ubuntu workspace
- Model:
gpt-5.6-sol - Reasoning effort:
highthrough2026-07-18T19:59:57Z- switched to
ultraat2026-07-18T20:02:30Z
- Thread/session ID:
019f74ea-cacf-7c91-81b7-2d1502414f94 - Reported model context window:
258,400tokens - No persisted
/goalwas active for this thread.
Observed compaction timeline (UTC)
The rollout contains 24 compacted events between 2026-07-18T11:28:57Z and 2026-07-19T01:30:02Z.
The nearest preceding token-count samples were approximately 196,548–218,387 input tokens against the reported 258,400-token context window.
| # | Timestamp (UTC) | Reasoning effort | Nearest preceding input tokens |
|---|---|---|---|
| 1 | 2026-07-18T11:28:57.728Z | high | 218,387 |
| 2 | 2026-07-18T13:47:52.139Z | high | 204,127 |
| 3 | 2026-07-18T14:20:15.106Z | high | 208,481 |
| 4 | 2026-07-18T14:52:24.390Z | high | 216,276 |
| 5 | 2026-07-18T15:59:35.164Z | high | 208,546 |
| 6 | 2026-07-18T17:05:31.396Z | high | 214,973 |
| 7 | 2026-07-18T17:40:13.392Z | high | 208,926 |
| 8 | 2026-07-18T18:15:05.095Z | high | 209,486 |
| 9 | 2026-07-18T18:35:05.715Z | high | 213,696 |
| 10 | 2026-07-18T19:05:01.808Z | high | 209,219 |
| 11 | 2026-07-18T19:24:30.682Z | high | 210,305 |
| 12 | 2026-07-18T19:59:57.049Z | high | 202,861 |
| 13 | 2026-07-18T20:17:51.571Z | ultra | 208,630 |
| 14 | 2026-07-18T20:58:19.400Z | ultra | 196,548 |
| 15 | 2026-07-18T21:25:02.192Z | ultra | 203,493 |
| 16 | 2026-07-18T21:50:59.897Z | ultra | 207,961 |
| 17 | 2026-07-18T22:22:22.813Z | ultra | 200,071 |
| 18 | 2026-07-18T22:52:35.568Z | ultra | 198,649 |
| 19 | 2026-07-18T23:11:28.513Z | ultra | 206,130 |
| 20 | 2026-07-18T23:46:11.890Z | ultra | 202,179 |
| 21 | 2026-07-19T00:15:34.308Z | ultra | 200,672 |
| 22 | 2026-07-19T00:38:20.535Z | ultra | 200,405 |
| 23 | 2026-07-19T01:01:11.126Z | ultra | 200,087 |
| 24 | 2026-07-19T01:30:02.695Z | ultra | 203,966 |
There were 12 compactions before Ultra and 12 after switching to Ultra. The 12 Ultra events span about 5 hours 12 minutes, with most adjacent events roughly 19–40 minutes apart. This makes Ultra an important affected configuration, but the trace does not establish that Ultra alone causes the bug.
Concrete convergence failure
During the Ultra phase, the post-compaction status repeatedly returned to the same high-level frontier:
- finish the remaining small set of issues;
- build an exact staged snapshot;
- run hostile/targeted verification;
- create a local commit.
This pattern recurred after compactions 13–24 while new "last" issues kept being rediscovered and the terminal state was not reached.
At 2026-07-19T01:10:00Z, the user explicitly asked whether the agent had become stuck due to compaction cycles. After compaction #24 at 2026-07-19T01:30:02.695Z, the agent again denied looping and restated essentially the same remaining frontier: two final items, staged verification, then a local commit.
The retained replacement history was not empty: it contained multiple user/developer messages plus an encrypted compaction item. That is why this issue is framed as frontier degradation / failure to converge, not complete loss of all context.
Expected behavior
After compaction, Codex should preserve a compact but explicit execution checkpoint:
- active objective and constraints;
- completed actions and evidence;
- unresolved items;
- exact next action;
- terminal condition;
- explicit "do not repeat" boundaries.
The next model turn should reconcile against that checkpoint and continue from the first unfinished item without re-announcing or reopening completed work.
Actual behavior
The broad objective survives, but the post-compaction model repeatedly reconstructs the work at too high a level. It remembers facts while losing enough completion state to reopen the audit and postpone its terminal step across many consecutive compactions.
Impact
- Multi-hour non-converging runs.
- Rapid consumption of included Codex allowance and/or purchased credits.
- Duplicate investigation, verification, and potentially mutations.
- Reduced trust in long autonomous tasks even when individual post-compaction messages appear locally coherent.
Reproduction
- Start a long multi-stage Codex Desktop task with explicit completion criteria.
- Let it run until several automatic
context_compactedevents occur. - Record the last pre-compaction plan/checkpoint.
- Compare it with the first post-compaction status and actions.
- Repeat across several compactions.
- Observe whether Codex repeatedly returns to a previously announced "last steps" frontier instead of reaching the terminal condition.
Relationship to #32922
#32922 reports persisted goal context being discarded by compaction. This reproducer did not have an active persisted /goal, and the overall objective remained available. The observed failure is narrower/different: completed-vs-pending execution state degraded enough to prevent convergence while many detailed facts still survived.
The issues may share a compaction-retention boundary, but this is not proven to be the same root cause.
In-product feedback correlation
This incident was also submitted through Codex in-product /feedback from the affected ChatGPT account, with logs attached.
- Feedback reference / affected thread ID:
019f74ea-cacf-7c91-81b7-2d1502414f94 - GitHub reporter: @Leviann
The in-product submission should provide OpenAI with the private account and diagnostic metadata needed to correlate this public report without publishing the account email here.
Activity
github-actions commentedon Jul 19, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
[-][Rate Limits] Infinite compaction loop on gpt-5.6-sol (ultra reasoning) causes rapid quota exhaustion[/-][+][Context] Repeated auto-compaction degrades execution frontier and prevents convergence in long tasks[/+]Akshmit commentedon Jul 21, 2026
Ran into this non-convergence pattern as well, after repeated context compactions, long sessions would hit ~2GB memory usage and loop indefinitely while re-stating the same "final verification/commit" frontier. To handle this during multi-hour tasks, I'm building a lightweight watchdog utility that monitors compaction loops, rotates session logs, auto-terminates non-converging runs, and verifies genuine terminal state completion. I plan to open-source it tomorrow, let me know if you'd like me to share a link or tag you here once it's pushed!
planetzalex commentedon Jul 23, 2026
Why does this behavior exist even after they halved the context window? Bad things happening at OpenAI.
To partially mitigate this absolute fucking bullshit-ass problem that still exists today, I added a compaction counter to every task and force a new task with a fresh context after three compactions. This is a stupid fix for a problem that should NEVER have existed.
grtninja commentedon Jul 23, 2026
Additional Windows Codex Desktop evidence is in #35032. In the affected production thread, compaction visibly completed but left the session at roughly 80% context occupancy, after which plans and acceptance criteria began repeating while paid usage continued to fall. This supports the execution-frontier degradation reported here and adds a concrete post-compaction headroom measurement. A useful mitigation would be a circuit breaker that creates a bounded handoff when compaction cannot reclaim safe working space.
grtninja commentedon Jul 23, 2026
Independent corroboration and narrower telemetry case: #35032 reproduces the same execution-frontier/convergence failure in Codex Desktop on Windows, with the visible
Context automatically compactedevent followed immediately by roughly 80% context occupancy. The affected thread then compacted again after only a small amount of work, repeated plans/tool activity, and exhausted included usage before the repository task completed. Another user independently replied on #35032 that a ten-minute fix was taking three-to-five times longer. This supports the report here and adds a measurable post-compaction reclamation symptom.GG95-lab commentedon Sep 25, 2026
I've been running into a very similar problem in long Codex Desktop sessions, especially after repeated compactions.
I ended up building a small Windows tool that tracks compaction/session health signals and creates a structured handoff into a fresh Codex session.
I'm running a public beta here if anyone dealing with the same problem wants to try it:
https://github.com/GG95-lab/FreshThread-BETA-version
oskaritooo commentedon Sep 26, 2026
Independent Windows Codex Desktop reproduction from 2026-09-26 that appears related to this issue. I am not claiming that compaction is proven to be the cause; I am adding this because the same non-convergence occurred in a run containing three automatic compactions, with a directly inspectable local JSONL.
Environment
0.155.0-alpha.9.2gpt-6-lunaxhigh25840001a0dcd4-d052-7a42-a396-01a02627051eThe affected root turn started at
2026-09-26T08:29:17Zand ended with a user interruption at2026-09-26T10:19:20.868Z.The rollout records:
So the single turn ran for approximately 1 h 50 min 03 s before I stopped it manually.
Compactions in the affected turn
The local rollout contains three
compactedevents:2026-09-26T08:55:03.436Z2026-09-26T09:29:22.593Z2026-09-26T10:10:54.250ZConcrete non-convergence behavior
The task was narrowly scoped: diagnose and fix physical ON/OFF control latency, with explicit instructions to verify the actual runtime and physical device rather than declaring success from unit tests.
Early runtime traces already narrowed the cause space substantially. One representative early trace showed approximately:
A later P1 path showed ~2842 ms associated with
uncertain-command-observation.In other words, the evidence already indicated that ordinary queue wait / worker-lock contention was not the main explanation for the observed end-to-end delay.
Despite this, the run continued through additional instrumentation, more tests, runtime restarts, code changes (including commit
6f26da9), observer-load testing, and further trace inspection without reaching a stable diagnosis/terminal condition. I eventually aborted the turn.At the end of the turn, the local token counter recorded
22,250,946total tokens including cached input. I am not treating that local counter as billed usage; it is included only to show the execution scale.Why I think this may be useful here
This run is much shorter than the 24-compaction reproducer in the original report, but it shows a similar failure shape: the broad objective remained known, significant evidence was gathered, yet the execution did not efficiently converge and continued reopening/expanding diagnostic work across several compactions.
I cannot establish from the client log alone whether the compactions caused the behavior. The session ID above should allow OpenAI to correlate this with server-side telemetry if useful.
Report preparation disclosure
I verified the session ID, CLI version, model/reasoning, compaction timestamps, turn duration, and termination directly from the local Codex JSONL. AI assistance was used to search/organize the records and draft this comment; AI is not the telemetry source.