GPT-5.5 max_context_window prevents larger model_context_window overrides

Resolved 💬 1 comment Opened May 10, 2026 by brandomagnani Closed May 10, 2026

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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗