Repository navigation
fix(server): stop Codex turns stuck in a compaction loop - #119
Closed
nullStack65 wants to merge 2 commits into
Closed
nullStack65 wants to merge 2 commits into
nullStack65 wants to merge 2 commits into
Conversation
Track Codex compactions per thread. Three within five minutes appends a visible error activity and interrupts the active turn without resuming. Model: claude-opus-5-5 Task: coding Agent: T3 Claude Code (CLO-921 lane) Lane: magpie Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
A manual /compact tags only the first of Codex's two compaction signals, so the untagged pair was still counting. Three manual compacts, or one manual plus two automatic ones, could stop the turn. That pair is now ignored. A loop that trips while no turn is active keeps its history, so the next compaction on a live turn still stops. Model: grok/grok-4.7 Task: coding Agent: T3 Codex (CLO-921 lane) Lane: magpie
Owner
Author
|
Moved: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Codex sessions were compacting in a loop. The token burn analysis (the parent token burn analysis, CLO-910) found 711 Codex compactions less than 5 minutes apart across 9 sessions, and two single-turn sessions that compacted 128 and 81 times. Each compaction re-reads about 372k of context. The evidence is
docs/token-burn-analysis-20261119.mdin the token burn analysis pull request, https://github.com/nullStack65/closura-agent-config/pull/953.A Codex thread now keeps a short compaction history. The named default
CODEX_COMPACTION_LOOP_LIMITis 3 compactions in 5 minutes. Codex emits two signals for one compaction (thecontext_compactionitem and the legacythread/compactednotification); a 2 second window counts that pair once. A manual/compactis left alone. On the third compaction inside the window, while a turn is active, the thread gets an error activity, "Stopped a context compaction loop", and the active turn is interrupted. Nothing resumes it, and the interrupt also drops queued after-compaction turns. The history resets on that trip, so a continued loop trips again, and it clears when the session exits.Out of scope: the Codex auto-compact limit, models, and account settings.
Verified here, on head
1fd3fae5bc20cd65490eb1939e01b5e5b26f72d4: the guard tests and the two ingestion replays (8 passed, 93 other tests in that file skipped),apps/servertsc --noEmitexit 0 after replacingnew Date()with EffectDateTime, and targeted format and lint on the four changed files. An earlier full run of both test files passed (101 tests) before thatDateTimeswap. CI is not verified yet.No human reviewers requested. Kameron is the only human reviewer.
Model: grok-4.7
Task: coding
Agent: T3 Codex, resuming the Claude Opus 5.5 implementation on the Codex compaction loop guard (CLO-921)