Codex Desktop enters context compaction loop and repeatedly re-analyzes project without executing requested task
What version of the Codex App are you using (From “About Codex” dialog)?
26.611.62324
What subscription do you have?
Pro
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Summary
Codex Desktop entered a loop where it repeatedly compacted context and restarted the same analysis phase without making progress on the requested task.
Codex should inspect the relevant files once, understand the task, and then implement the requested code changes.
Actual Behavior
Codex repeatedly entered "Automatically compacting context" and then restarted the exact same planning phase.
Instead of implementing the requested functionality, it kept producing messages such as:
"First I'll inspect the classes..."
"I'll review the existing files..."
"I'll check the current signatures..."
"I'll look at the project structure..."
The same analysis step was repeated dozens of times.
No meaningful code changes were produced.
Additional Issue
During this process, the original user prompt disappeared from the conversation history and could no longer be recovered.
The assistant responses remained visible, but the original request was missing.
Impact
Approximately 30% of my monthly usage quota was consumed.
The requested implementation was never completed.
The conversation became unusable.
The session appeared stuck in a context compaction / re-analysis loop.
Possible Cause
It looks like context compaction may be preserving the high-level task goal while losing progress information, causing Codex to repeatedly restart the analysis phase instead of continuing the implementation.
What steps can reproduce the bug?
Open a long-running Codex Desktop session.
Work on a large project.
Request implementation of specific C++ functionality.
Allow multiple automatic context compactions to occur.
Observe repeated re-analysis of the same files and loss of progress.
What is the expected behavior?
Codex should inspect the relevant files once, understand the requested task, and then implement the requested code changes.
After reading the necessary files, it should proceed with editing code instead of repeatedly restarting the analysis phase.
The conversation should preserve task progress across context compactions and continue working on the implementation without re-reading the same files indefinitely.
Additional information
- The issue occurred repeatedly over a long period of time, not just once.
- The assistant kept producing nearly identical planning messages after each context compaction.
- The original user prompt disappeared from the conversation history, making it impossible to verify the initial instructions.
- The assistant appeared to remember the overall goal but repeatedly forgot its progress, causing it to restart the same analysis step.
- No meaningful code modifications were produced despite significant usage consumption.
- The project was C++ project, but the problem does not appear to be related to any specific codebase. The failure occurred before implementation and during task planning/recovery.
- The behavior strongly resembled a loop between context compaction and project re-analysis.
- Restarting the conversation was ultimately the only workaround.
<img width="770" height="775" alt="Image" src="https://github.com/user-attachments/assets/580a843a-86ad-4c9a-94b3-34168e9086b2" />
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗