Codex CLI prematurely auto-compacts context; effective threshold clamped to 90% of window

KernelBypass · ghdev · 2026-10-17

A detailed openai/codex issue (#54825) reports that Codex CLI 0.162.0-alpha.17.2 repeatedly auto-compacts long coding conversations at around 600k–700k tokens, despite a configured 1M-token context window and 900k compaction threshold, interrupting work earlier than the UI suggests.

Diagnostics confirm the 900k setting was loaded, yet compaction triggered at 917,130 tokens while the immediately preceding response reported only 638,856 total tokens — an unexplained accounting/UI discrepancy.

Offline tests with the same executable also show that setting the threshold above the context window (even to the max signed 64-bit integer) does not disable auto-compaction: the effective threshold is clamped to 90% of the selected context window.

Original post →

More from coding & agent

coding & agent channel →