Enabling the 1M-token window for GPT-5.6 Sol in Codex
- Source
- x.com
- Publisher
- Thibault Sottiaux
- Date
Here is how to enable a 1M-token context window in Codex for GPT-5.6 Sol. Even though we have tuned the context limit in Codex to be set optimally when it comes to performance and cost, this is a common ask, so here it is documented. A larger context window lets Codex retain more code, tool output, and conversation history before summarizing older material. You need a model that supports it. And GPT-5.6 Sol, for example, has a documented 1,050,000-token window. Open ~/.codex/config.toml and add or update these settings at the top level, before any [section] headers: ``` model = "gpt-5.6-sol" model_context_window = 1000000 model_auto_compact_token_limit = 900000 ``` The first setting selects the model. The second tells Codex to use a one-million-token context budget. The third starts automatic history compaction around 900,000 tokens, leaving some headroom. Restart Codex client and start a new session after saving. To try the configuration for a single CLI session without changing your defaults: ``` codex -m gpt-5.6-sol \ -c model_context_window=1000000 \ -c model_auto_compact_token_limit=900000 ``` Have fun, but also know that we tuned the default carefully!
Context
Codex can be set to give OpenAI's GPT-5.6 Sol a one-million-token with three lines of configuration, but the Codex team says its default was chosen deliberately. Tibo's August 16, 2026 post documents the setting because people often ask for it. The context window is how much text the model can take in at once. When a Codex gets close to its limit, Codex summarizes older material, a step called , so a larger window lets it keep more code, tool output and conversation history in full before that happens. The post says the model has to support the larger window, and that GPT-5.6 Sol has a documented window of 1,050,000 tokens.
The change goes at the top of ~/.codex/config.toml, before any section headers: model = "gpt-5.6-sol" selects the model, model_context_window = 1000000 sets the budget to one million tokens, and model_auto_compact_token_limit = 900000 starts automatic compaction at about 900,000 tokens to leave some headroom. After saving, the user restarts the Codex and starts a new session. To try the larger window for a single command-line session without changing the defaults, the same values can be passed as flags: codex -m gpt-5.6-sol -c model_context_window=1000000 -c model_auto_compact_token_limit=900000.
The post says the default limit was tuned for performance and cost, and it ends with a reminder that "we tuned the default carefully". It does not give the default value or say how much a larger window changes cost or answer quality, so the tradeoff is stated but not measured. Only the first post of the thread was collected, so any later replies are not covered here.
- Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
- Session — One conversation or piece of work as a harness keeps it: a record of messages, tool calls and observations that can be saved and resumed.
- Compaction — Replacing older content in the model's context with a summary of it, usually keeping recent messages, so that a session can go on.
- Client — The program that sends a request to a server and receives its response.


