Quick answer
Setmodel, model_context_window, and model_auto_compact_token_limit at the top of config.toml, then fully restart Codex and start a new conversation. GPT-5.6 Sol has an official API context window of 1,050,000 tokens. The configuration below gives Codex a 1,000,000-token context budget and starts automatic compaction around 900,000 tokens.
Save the setting in config.toml
Open the Codex user configuration file:
Place these lines at the top level, before every
[section] header:
The
900000 compaction threshold leaves room for model output, tool results, and later messages before the configured context budget is exhausted.Enable it for one CLI session
Use-c overrides when you do not want to change your defaults.
- macOS / Linux
- Windows PowerShell
Verify the configuration
- Fully restart Codex and create a new conversation.
- Confirm that the active model is
gpt-5.6-sol. - If the model is unavailable, check the current Model ID and provider support in the model plaza.
- If Codex ignores the values, confirm that they are top-level fields in the correct user file and are not declared twice.
Why the usable context may be lower
model_context_window tells Codex the context budget available to the model. Output tokens, tool calls, system instructions, client settings, and server-side limits can reduce the effective space. Codex may also compact history before the full budget is reached. Treat one million as the requested budget, not a promise that every request can fill it.
Usage and cost
A larger context can retain more code, terminal output, and conversation history during long tasks, but it can also increase input tokens, latency, and cost substantially. The default is usually better for short tasks. Check current model and billing details in the model plaza.Related docs
- Codex installation and custom provider setup
- Complete Codex config.toml guide
- How model_provider, Base URL, and wire_api work

