Compaction hangs indefinitely at <16%
Open 💬 5 comments Opened Mar 12, 2026 by guidedways
💡 Likely answer: A maintainer (github-actions[bot], contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
v0.114.0
What subscription do you have?
Pro
Which model were you using?
gpt-5.4
What platform is your computer?
macOS
What terminal emulator and version are you using (if applicable)?
iTerm2
What issue are you seeing?
Every time now - when the context is around 15% or less, auto-compaction can hang indefinitely (waited for 30 minutes) - it just says "working" but I'm assuming it's compacting since at that point it usually does.
What steps can reproduce the bug?
Give codex some work that would fill up the entire context and force it to compact, after the first or second time it'll just hang on "working" if the context is around 15% or lower.
I end up quitting codex, re-starting (at that time it doesn't even show me the normal resume with ... message) and then manually /resume the session, then run a manual /compact which finally works).
What is the expected behavior?
_No response_
Additional information
_No response_
5 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
You'd think compaction would be good for the cluster: a one-time pass that shrinks session context and reduces future token load. But with sessions hanging for tens of minutes, it almost feels like compaction requests are getting stuck or deprioritized.
Could this be because compaction replaces the prompt prefix and invalidates existing KV/prompt cache state, forcing the request onto a slower path? It feels like OpenAI is slapping compactions with (counterintuitive) penalization/throttling.
This may only happen when you use gpt-5.4 instead of a codex model like gpt-5.3-codex. I was able to switch models, compact, and then switch back.
For me, it only happens if it's compacting and I queue a message for after compaction.
This is still ongoing. And it indeed only happens to me if I queue a message after compaction (thanks @timhaak). Hung for ~15 min. A manual compact finished in <1min.