codex - 💡(How to fix) Fix GPT-5.5 max_context_window prevents larger model_context_window overrides [1 comments, 2 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#21993Fetched 2026-05-11 03:21:32
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4closed ×1commented ×1

GPT-5.5 currently has max_context_window set to 272000 in the bundled Codex model catalog, so model_context_window overrides above that value are clamped. This prevents users from opting into larger GPT-5.5 context windows. Official OpenAI model docs list GPT-5.5 with a 1,050,000 token context window.

Docs:

Root Cause

Codex still reports an effective context around 258400 tokens because:

Fix Action

Fix / Workaround

I prepared a one-line patch here:

but stopped it after first-time Rust toolchain/dependency fetch took several minutes locally. The patch itself is a one-line bundled model catalog metadata change.

Code Example

model = "gpt-5.5"
model_context_window = 500000

---

272000 * 95% = 258400

---

{
  "slug": "gpt-5.5",
  "context_window": 272000,
  "max_context_window": 272000,
  "effective_context_window_percent": 95
}

---

{
  "slug": "gpt-5.4",
  "context_window": 272000,
  "max_context_window": 1000000,
  "effective_context_window_percent": 95
}

---

context_window.min(max_context_window)

---

context_window.saturating_mul(effective_context_window_percent) / 100

---

-      "max_context_window": 272000,
+      "max_context_window": 1050000,

---

cargo test -p codex-models-manager model_context_window -- --nocapture
RAW_BUFFERClick to expand / collapse

Summary

GPT-5.5 currently has max_context_window set to 272000 in the bundled Codex model catalog, so model_context_window overrides above that value are clamped. This prevents users from opting into larger GPT-5.5 context windows. Official OpenAI model docs list GPT-5.5 with a 1,050,000 token context window.

Docs:

Current behavior

With config like:

model = "gpt-5.5"
model_context_window = 500000

Codex still reports an effective context around 258400 tokens because:

272000 * 95% = 258400

codex debug models shows:

{
  "slug": "gpt-5.5",
  "context_window": 272000,
  "max_context_window": 272000,
  "effective_context_window_percent": 95
}

For comparison, GPT-5.4 currently exposes a larger override path:

{
  "slug": "gpt-5.4",
  "context_window": 272000,
  "max_context_window": 1000000,
  "effective_context_window_percent": 95
}

So model_context_window = 500000 works for GPT-5.4 but is clamped for GPT-5.5.

Code path

model_context_window is clamped to the catalog max in codex-rs/models-manager/src/model_info.rs:

context_window.min(max_context_window)

The visible context window is then computed in codex-rs/core/src/session/turn_context.rs as:

context_window.saturating_mul(effective_context_window_percent) / 100

Proposed fix

Keep GPT-5.5 default context_window at 272000, but raise max_context_window to 1050000, matching the official GPT-5.5 model docs. This keeps larger windows opt-in via model_context_window while allowing users to configure them.

I prepared a one-line patch here:

Diff:

-      "max_context_window": 272000,
+      "max_context_window": 1050000,

GitHub says outside PRs are limited to collaborators for this repo, so I could not open a PR directly.

Testing

Started:

cargo test -p codex-models-manager model_context_window -- --nocapture

but stopped it after first-time Rust toolchain/dependency fetch took several minutes locally. The patch itself is a one-line bundled model catalog metadata change.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING