codex just compacts repeatedly for hours at a time before it is able to make a change
What version of Codex CLI is running?
0.112
What subscription do you have?
Pro
Which model were you using?
5.4-xhigh
What platform is your computer?
darwin m3 max
What terminal emulator and version are you using (if applicable)?
ghostty
What issue are you seeing?
each compaction leaves codex with only like 12% context remaining, and so it is impossible to actually do anything. I'm like "great, can you make the change per the spec and discussion" and then it compacts from 10% to 15%, reads a few files, compacts from 5% to 12%, reads a few files, compacts, reads a few files, compacts, etc.
it has done this about 6 times in a row, and it has not been able to patch a single file yet after around 2 hours, and I bet its understanding of the change I want is degrading due to game of telephone.
this is completely unusable and I did not see the issue on older versions like 0.109 IIRC
What steps can reproduce the bug?
run a session with a bunch of docs and files touched. not really a large change, affecting less than 30 files and 10 docs.
What is the expected behavior?
for the /compact feature to actually /compact context to some reasonable extent, or to overall design the product in a way that makes it possible for the agent to edit code without just sitting there compacting repeatedly for hours.
Additional information
_No response_
18 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
seeing the same behavior. any workaround?
This is a _real_ problem for me now
I switched to reasoning effort high instead of xhigh - so far it's working and didn't get stuck
I reverted to 5.3 and set it to HIGH, and now when I compact it ACTUALLY compacts.
(I hope this will help devs to find the problem and users to get around it!)
I just realised I used 80% of my quota re-compacting repeatedly... ugh! Watch out people.
they know it's an issue.
seems a bit fast now after changing it from xhigh to high
@jamesheinlein @ohad7 @mercmobily I found that manually stopping all “Codex Helper” processes in Activity Monitor stops Codex from getting stuck while auto-compacting, and then just prompting it with “continue” fixes it for me. Hope this helps!
@CatnyapC Wait I am using codex-cli, I've never used the web version... is there an "activity monitor" in codex-cli too?
No, Activity Monitor on MacOS (equivalent to Task Manager in Windows),
My bad, I assumed you were using the new Codex App. I didn’t realize the CLI version had this auto-compacting issue too, thought it was only an app-side problem, since the app has been pretty bumpy since launch.
But with how unstable auto-compacting is right now, I think the app version is still worth using, since at least there’s something you can do about it when it's stuck compacting in a loop.
i don't experience this bug any more, Been running two days with xhigh codex app, no death spiral. I think it can be closed.
We deployed a fix for this. It was a server-side issue. Thanks everyone who reported this problem.
I just downloaded Codex and am facing this issue - as soon as my session hits 258k context I literally cannot proceed, it just gets stuck on 'compacting' and then fails repeatedly
Facing a similar issue - frequent context compacting, despite only 27-30% context usage. Codex is extremely slow at completing work due to this issue. Also happens when I open a new session.
I'm having this issue compacting after compacting without doing any work and then it wastes all my tokens, that should be reimburse.
In my Codex session, it keeps reading the same files over and over, and just when it seems like it’s finally about to move on to the next task, it gets compacted again and stops.