Global context settings appear to remain active after switching from gpt-5.4 to gpt-5.4-mini
What version of Codex is running?
0.118.0
What subscription do you have?
ChatGPT / Codex App
Which model were you using?
Primarily gpt-5.4, then switched to gpt-5.4-mini
What platform is your computer?
macOS 15
What issue are you seeing?
model_context_window and model_auto_compact_token_limit appear to be treated as global values even after switching to a model with a smaller real context window.
In my config I use:
model = "gpt-5.4"
model_context_window = 1000000
model_auto_compact_token_limit = 500000
This is valid for gpt-5.4, but after switching in the app to gpt-5.4-mini, the UI still appears to reflect the larger context window instead of the model's actual limit.
As a result:
- the app visually behaves as if
gpt-5.4-ministill has the large configured context window - auto-compaction does not happen early enough
- the session eventually fails near the smaller real model limit with a context window exceeded error
What steps can reproduce the bug?
- Set the config to:
``toml``
model = "gpt-5.4"
model_context_window = 1000000
model_auto_compact_token_limit = 500000
- Start Codex App.
- Use
gpt-5.4successfully. - Switch the model in the app to
gpt-5.4-mini. - Continue a long session until the token count approaches the smaller real limit for
gpt-5.4-mini. - Observe that auto-compaction does not trigger early enough and the session eventually errors due to context overflow.
What is the expected behavior?
When switching from gpt-5.4 to gpt-5.4-mini, Codex should do one of the following automatically:
- clamp the effective context window to the selected model's real max
- clamp the effective auto-compact threshold below that model's max
- update the UI to show the effective per-model context window instead of the stale global configured value
- warn the user that the current global settings exceed the selected model's supported context
Additional information
This looks especially confusing because the config is valid for gpt-5.4, but becomes unsafe when the model is switched to gpt-5.4-mini in the UI.
The core problem is not just the error itself, but that the app appears to keep showing/using the larger configured context semantics after the model switch.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗