codex - 💡(How to fix) Fix config.toml context window settings are not respected [5 comments, 6 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#19185Fetched 2026-04-24 05:59:15
View on GitHub
Comments
5
Participants
6
Timeline
15
Reactions
9
Timeline (top)
commented ×5labeled ×5subscribed ×2unlabeled ×2

Error Message

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.

Root Cause

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.

Code Example

C:\Users\12768\.codex\config.toml

---

model = "gpt-5.5"
model_reasoning_effort = "high"
model_context_window = 960000
model_auto_compact_token_limit = 800000
RAW_BUFFERClick to expand / collapse

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.

extent analysis

TL;DR

Check the maximum allowed value for model_context_window and model_auto_compact_token_limit in the Codex documentation to ensure the configured values are within the supported limits.

Guidance

  • Verify the configured values of model_context_window and model_auto_compact_token_limit are within the supported limits for the gpt-5.5 model.
  • Check the Codex documentation for any specific guidelines on configuring context-related settings.
  • Test with a smaller value for model_context_window to see if the issue persists, helping to isolate if the problem is with the specific value or the configuration process.
  • Consider checking for any validation or error messages in the Codex output or logs that might indicate why the configured value is being reduced.

Notes

The issue might be due to the model or client having a maximum limit for the context window, which is not clearly documented or communicated when exceeded.

Recommendation

Apply workaround: Use the maximum allowed value for model_context_window and model_auto_compact_token_limit as specified in the Codex documentation to ensure reliable control over context behavior.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

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.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING