config.toml context window settings are not respected
What happened?
The context-related settings in config.toml do not appear to take effect. I tried configuring Codex from:
C:\Users\12768\.codex\config.toml
Relevant settings:
model = "gpt-5.5"
model_reasoning_effort = "high"
model_context_window = 960000
model_auto_compact_token_limit = 800000
After setting a large context window, for example around 1M, Codex still automatically reports/uses about 258k instead. This makes it impossible to control the effective context window from the config file.
Expected behavior
model_context_window and model_auto_compact_token_limit should be honored, or Codex should report a clear validation/error message if the configured value exceeds the supported model/client limit.
Actual behavior
The configured value is silently reduced/ignored. For example, setting approximately 1M results in Codex automatically changing/using about 258k.
Environment
- OS: Windows
- Config path:
C:\Users\12768\.codex\config.toml - Model configured:
gpt-5.5
Why this matters
Users cannot reliably control context behavior through config.toml, and the silent conversion makes it difficult to understand whether the setting is unsupported, capped by the model, capped by the client, or being parsed incorrectly.
24 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
gpt 5.5 doesn't have 1m context window with codex :(
I can reproduce/confirm this on Codex Desktop for macOS as well, and it looks like the config is being loaded but then clamped by model metadata rather than ignored.
Environment I checked:
26.422.20832codex-cli 0.124.0-alpha.2gpt-5.5Observed model metadata from the installed app:
| model | context_window | max_context_window | effective_context_window_percent |
|---|---:|---:|---:|
|
gpt-5.4| 272000 | 1000000 | 95 ||
gpt-5.5| 272000 | 272000 | 95 ||
crest-alpha| 272000 | 272000 | 95 |The relevant source path appears to be
with_config_overrides, which clamps the configured context window tomax_context_window:https://github.com/openai/codex/blob/3f8c06e457e1d2d9faa907738e97c0c5d3ab5bd5/codex-rs/models-manager/src/model_info.rs#L29-L36
So for
gpt-5.5,model_context_window = 1050000becomesmin(1050000, 272000) = 272000. Then the effective context shown/used is further reduced byeffective_context_window_percent = 95, which explains the ~258400 number.The struct docs also describe
max_context_windowas the maximum allowed for config overrides:https://github.com/openai/codex/blob/3f8c06e457e1d2d9faa907738e97c0c5d3ab5bd5/codex-rs/protocol/src/openai_models.rs#L279-L285
And auto-compact is similarly capped to 90% of the resolved context window:
https://github.com/openai/codex/blob/3f8c06e457e1d2d9faa907738e97c0c5d3ab5bd5/codex-rs/protocol/src/openai_models.rs#L310-L318
This makes the current behavior understandable but surprising:
gpt-5.4can use 1M because its catalog entry advertisesmax_context_window = 1000000;gpt-5.5cannot because its catalog entry advertisesmax_context_window = 272000.Expected improvement: if this is intentional because
gpt-5.5does not currently support 1M in Codex, Codex should surface a clear warning/status message when config values are clamped, e.g.model_context_window=1050000 was reduced to 272000 because gpt-5.5 max_context_window is 272000. Ifgpt-5.5is supposed to support 1M, then the model catalog entry likely needs to advertise the largermax_context_window.https://github.com/openai/codex/issues/19208#issuecomment-4308290104
https://github.com/openai/codex/issues/19208#issuecomment-4308373911
It sounds expected, but I am unhappy with that...
setting to 400000 is not working as well
This looks like a real joke. 258,000 is not a thing that you can rely on for heavy-duty work, complex or long projects or planning It's absolutely disappointing.
1M being available on 5.5 would be nice but the actual bug here is it's supposed to be 400k (which is more tolerable at least).
So currently you can have 5.4 @ 1M or 5.5 @ 272k, but not 5.5 @ 1M or even the advertised 5.5 @ 400k.
258k in 2026 is a real nonsense
<img width="679" height="196" alt="Image" src="https://github.com/user-attachments/assets/872be77f-022a-4e88-86c7-05224d0d104f" />
Honestly absurd.
A model marketed for complex coding and research gets capped at 258k, and nobody has even said why.
So what exactly is “real-world work ...” supposed to mean here?
Still nothing. No response, no fix!!
so it seems even pro accounts have 258k limit? this is an absolute scam
Codex supports a 400K context window for gpt-5.5. Of the 400K, there is 272K for input and 128K reserved for output tokens. We trigger auto-compaction at the 90% mark, which is 258K. Auto-compaction allows you to run extremely long sessions. I run sessions that take days and involve hundreds of auto compaction cycles.
A 400K context size (with a 258K auto-compaction trigger) is the same default setting used by previous models including gpt-5.4, gpt-5.3-codex, and gpt-5.2. We did offer a larger context window as an option for gpt-5.4, but many users reported problems when using this feature. You will generally get much better results, even with gpt-5.4, by using the default context window size and relying on auto-compaction for long-running tasks.
@etraut-openai thanks for your response, however:
model_context_windowin config.toml, when we talk about 1M context that means input, etc.. Summing input & output to get a larger number seems like marketing so let's not do that.So we have a choice 5.4 which is bad at long context but can do 1M, or 5.5 which is good at long context but it's not available. How does this make sense?
The overall result is that (at least on subscription plans) codex + gpt 5.5 can't compete with Opus 4.6/4.7 which are 1M by default now. This doesn't seem like a good outcome for OpenAI.
@mark-99, thanks for the feedback.
There are a couple of different concepts that are getting conflated here, which is understandable because we're sometimes sloppy about using the term "context window" to mean different things in different contexts. When we talk about the context window capabilities of a model, we're talking about the total context that it supports.
When a model is used in the context of Codex (or any other agent harness), that total context window needs to be managed to avoid overflow. That leads to the need to distinguish between input and output token capacities.
There are many factors that go into decisions about which context window sizes to support — including model capabilities, hardware capacity, hosting costs, user needs, etc.
Someone has opened a feature request: #19464. We'll use that to gather additional feedback and upvotes on this topic. Let's keep the discussion going there.
@etraut-openai Thanks for the clarification.
I don’t want to get into the side arguments here, but I do want to emphasize the main point: larger configurable context is one of the most important features for real-world Codex usage right now.
Most serious competitors already support much larger context windows, and GPT-5.5 appears to be a model that could benefit from that capability. It is reasonable to keep the current 258K auto-compaction behavior as the default, but users should still have the freedom to override it when their workflow requires it.
There is no single setting that works for every user and every project. For large codebases, tightly connected files, long debugging sessions, migrations, planning, and multi-step development work, losing context through compaction can be a major problem. Auto-compaction is useful, but it is not a replacement for true long context. It can make the model lose important details, drift from the task, or force the user to spend extra time re-explaining what was already known.
Please consider bringing back support for a larger optional context window, especially for users who explicitly configure it and understand the tradeoffs. The default can stay conservative, but advanced users should not be blocked from choosing the larger context window when they need it.
I hope this feature returns soon.
(this message applies only to api key users who want long contexts)
FYI @litaotju you can use a custom
models.jsonfile to fix your issue. Inconfig.toml, setmodel_catalog_json=<path to your models.json>. Copy the contents of~/.codex/models_cache.jsoninto that your custommodels.json. Forgpt-5.5, set"max_context_window": 1000000. I tested long contexts with this solution, it works as you'd expect.Using a custom
models.jsonis handy. I also use it to clean up my model picker of models I don't use.Tried it - but it only leads to that codex shows "context window out of bounds" eventually
(pro subscription, not api)
@astandrik Yep. Looks like there's a server-side gate for long context.
So, is the subscription plan useful?
---- Replied Message ----
From @.> Date 04/25/2026 16:15 To @.> Cc @.>@.> Subject Re: [openai/codex] config.toml context window settings are not respected (Issue #19185)
miraclebakelaser left a comment (openai/codex#19185)
@astandrik Yep. Looks like there's a server-side gate for long context.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>
It doesn't matter which subscription you have, or why you think having a different subscription makes any difference. In Codex, the only difference between subscriptions is in rate limits. Nothing else.
@MeXenon they are likely referring to the fact that enterprise/API gets 1M and subscription does not.
yes, I am in pro subscription but no 1m ,pity,
---- Replied Message ----
From @.> Date 04/25/2026 19:42 To @.> Cc @.>@.> Subject Re: [openai/codex] config.toml context window settings are not respected (Issue #19185)
mark-99 left a comment (openai/codex#19185)
@MeXenon they are likely referring to the fact that enterprise/API gets 1M and subscription does not.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you authored the thread.Message ID: @.***>
This limitation is seriously damaging real workflows.
258K is not enough for serious coding work on medium-to-large codebases. Debugging, planning, and building connected features all suffer badly :(
Please stop forcing one conservative default on everyone. This feels stubborn and dismissive of real user needs. Bring back the option for larger context windows.
cc @bolinfest @aibrahim-oai @jif-oai @pakrym-oai
Please take the conversation to #19464.