Compaction death spiral

Open 💬 0 comments Opened Mar 2, 2026 by donutdaniel

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

26.228.1430

What subscription do you have?

Pro

What platform is your computer?

Darwin 25.2.0 arm64 arm

What issue are you seeing?

Seems like a side effect of short context windows and compaction context loss is that an agent can easily get into a death spiral where if the read context > context window, it will repeat the same read-codebase work after compaction. For example codex 5.3 spark is 86k after the system message on codex app, and if it reads more than a couple files then it will overflow and restart the work on next agent turn. Kept it running for ~10 minutes and it never broke out of the loop.

What steps can reproduce the bug?

Give codex 5.3 spark a large task, one that will require a lot of reading to fill up the context window, and then let it autocompact. It should repeatedly do the same work, e.g. "ive got the high level roadmap read x.... explored x files... etc" -> compact -> "ive got the high level roadmap, read x.... explored x files... etc" -> so on and so forth

What is the expected behavior?

The agent does not repeat work after a compaction. It can use the information gained from compaction even if the reads are large

Additional information

_No response_

View original on GitHub ↗