Autocompact won't turn off

Resolved 💬 3 comments Opened Jan 17, 2026 by pauldonnan Closed Jan 17, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

codex-cli 0.87.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.2-codex

What platform is your computer?

Darwin 25.0.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

Terminal.app

What issue are you seeing?

Autocompact turned off at command line (codex -- --autocompact:off) (also tried various approaches in toml), TUI confirms it's off, still auto-compacts with no warning at about 50% context usage. I'm managing the context myself to avoid the abundance of issues caused by auto-compaction. Please fix this urgently. Absolute joke having big context windows without this "feature" being toggle-able.

What steps can reproduce the bug?

Uploaded thread: 019bc7c9-9538-7a93-a4f2- 00ae1e38ef27

What is the expected behavior?

Auto-compact OFF

Additional information

_No response_

View original on GitHub ↗

3 Comments

etraut-openai contributor · 7 months ago

We don't currently provide a way to disable auto compaction completely. You can specify the model_auto_compact_token_limit to hard-code the token threshold limit that triggers auto-compaction. If this is omitted from the config, Codex uses the model's default behavior for auto-compaction. Refer to the configuration reference for supported config keys.

RigoLigoRLC · 4 months ago

this is a very disappointing move. imagine an agent tool in which you cannot control how your context window is used!

Norlandz · 2 months ago

But at least, is there a way to specify how much token it BURNS for compact?
It burnt 15% of my token, but I would prefer to start a fresh chat instead if that must happen.

---

Update:

Note: just realized that the context window indicator was not suppose to disappear.
https://github.com/openai/codex/issues/24272