Development & Automation

How to Unlock the 1M Context Window for GPT-5.6 Sol in Codex.

Three lines in config.toml give you a 1.05M-token window

· Huuush

How to Unlock the 1M Context Window for GPT-5.6 Sol in Codex

Key takeaways

  1. 1Add model = "gpt-5.6-sol", model_context_window = 1000000, and model_auto_compact_token_limit = 900000 to ~/.codex/config.toml.
  2. 2Save, then restart Codex. The settings apply when you open a new session.
  3. 3You can also run it once from the CLI.
Terminal settings screen running GPT-5.6 Sol in Codex with a 1M context window

One Million Tokens, Three Lines

It takes three lines.
The settings file is ~/.codex/config.toml.
Add the lines below and you're done.

model = "gpt-5.6-sol"
model_context_window = 1000000
model_auto_compact_token_limit = 900000

Save, then restart Codex.
The settings apply when you open a new session.

You can also run it once from the CLI.

codex -m gpt-5.6-sol -c model_context_window=1000000 -c model_auto_compact_token_limit=900000

These settings are exactly as in the original post.
Tibo Sottiaux shared them.
He is the lead of OpenAI Codex.

It was posted at 05:12 KST on 2026-08-17.
The original post has 584,000 views.

The target model is GPT-5.6 Sol.
Its documented context is 1,050,000 tokens.
Three lines turn on the 1M context.

You can follow the related discussion in GitHub issue 19464.
GitHub issue 19208 is also a useful reference.

Why Codex Hides the 1M Window

Codex's default context is tuned smaller.
The exact default figure hasn't been published.
It's a default that trades performance against cost.

Experimental 1M support has continued since GPT-5.4.
GPT-5.4 launched on 2026-03-05.
You can check GitHub issue 19464.
GitHub issue 19208 is also worth a look.

The key is balancing performance and cost.
A big window is powerful but heavy.

The Practical Headroom of 900K Compaction

Auto-compaction starts at 900,000 tokens.
It compacts before the context fills up.

There's 100,000 tokens of headroom between the window setting (1 million) and the compaction threshold (900,000).
Even as the conversation grows, you avoid abrupt truncation.

Here are the settings in a table.

Setting keyValueRole
model"gpt-5.6-sol"Selects the model
model_context_window1000000Context window size
model_auto_compact_token_limit900000Threshold for starting auto-compaction

1M Isn't a Cure-All

A large context has a price.
Latency and cost rise together.
That's why the default is tuned smaller.

1M support has been experimental since GPT-5.4.
You need to verify stability project by project.

For short tasks, the default setting is more efficient.
1M only pays off for long codebase analysis.
It's a setting to turn on only when you need it.

Frequently asked questions

What is the key point of "One Million Tokens, Three Lines"?
Add model = "gpt-5.6-sol", model_context_window = 1000000, and model_auto_compact_token_limit = 900000 to ~/.codex/config.toml. Save, restart Codex, and open a new session to apply the settings.
What is the key point of "Why Codex Hides the 1M Window"?
Codex's default context is tuned smaller. The exact default figure hasn't been published. It's a default that trades performance against cost. Experimental 1M support has continued since GPT-5.4. GPT-5.4 launched on 2026-03-05. You can check GitHub issue 19464. GitHub issue 19208 is also worth a look.
What is the key point of "The Practical Headroom of 900K Compaction"?
Auto-compaction starts at 900,000 tokens. It compacts before the context fills up. There's 100,000 tokens of headroom between the window setting (1 million) and the compaction threshold (900,000). Even as the conversation grows, you avoid abrupt truncation.

Related articles