Serious auto-compact bug: agent repeatedly enters a resume loop after conversation optimization.

Open 💬 4 comments Opened Jul 20, 2026 by villagestonehouse
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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

26.715.52

What subscription do you have?

Pro

What platform is your computer?

_No response_

What issue are you seeing?

Serious auto-compact bug: agent repeatedly enters a resume loop after conversation optimization.

After auto-compact / “Optimized the conversation,” the agent resumes with near-identical status messages, re-reads the same files, then compacts again. It does not appear to preserve progress across the compact boundary.

The agent may also deny the loop (“Still connected, and no loop”) while repeating the exact same cycle.

Impact:

  • Task appears active but makes no real progress.
  • User prompts like “are you still connected?” can restart the loop.
  • The agent may repeatedly re-read files or resume the same plan instead of producing a handoff.
  • This has happened twice across my work.

Expected behavior:
After compaction, the agent should continue from the next concrete step, or stop with a handoff if state is insufficient. It should detect repeated compact/resume cycles and exit safely rather than looping.

Observed repeated pattern:

  1. Agent says it will re-open/trace the active code path.
  2. “Read files”
  3. “Optimized the conversation”
  4. Agent says it is still connected and will re-open the same code path.
  5. “Read files”
  6. “Optimized the conversation”
  7. Same cycle repeats.

What steps can reproduce the bug?

Fix the bug

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

4 Comments

github-actions[bot] contributor · 1 month ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #34095

Powered by Codex Action

grtninja · 1 month ago

I reproduced a narrower, directly measurable version of this loop on Codex Desktop for Windows: the UI reported Context automatically compacted, but the context meter immediately remained about 80% full. After only a small number of operations, compaction triggered again and the execution frontier repeated. I filed #35032 with the exact occupancy symptom and screenshots. That post-compaction occupancy may be useful telemetry for diagnosing the resume-loop behavior described here.

gbonjack · 18 days ago

I am seeing the same failure repeatedly in Codex App 26.803.41515 on macOS (Darwin 25.5.0, arm64).

In a long-running project thread, the UI repeatedly shows “Optimized the conversation” instead of returning to the task. The loop continues until I force-stop the turn. If I then tell Codex that it is stuck and ask it to continue, it usually resumes, which makes this look like a compaction/resume loop rather than ongoing work.

This has occurred several times in the same project thread.

Feedback ID: 019f9efa-374d-7180-985d-98bd4f9e534f

Expected behavior: compact once and resume from the next concrete step, or surface a recoverable error. The app should detect repeated compaction attempts and stop the loop.

Beerbill · 16 days ago

<img width="1654" height="1058" alt="Image" src="https://github.com/user-attachments/assets/3929e515-1c8a-4a2d-9d74-ab99306af992" />

literally burning tokens into this loop behavior