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

Open
#34,322 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Quiet
Tech stack
rust
Domain
ai, cli

Research direction

The report names no source files, tests, or reproducible steps beyond triggering auto-compact in the Codex App. Start by reproducing the repeated resume/compact cycle, then trace the conversation compaction and resume flow; done means progress continues after compaction or the agent safely stops with a handoff and detects repeated cycles.

Written by the indexing model from the issue text.

Description

app bug context model-behavior
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

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.