Skip to content

GPT-5.5 max_context_window prevents larger model_context_window overrides #21993

Closed as duplicate

Description

@brandomagnani

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.

Activity

  1. added
    bugSomething isn't working
    CLIIssues related to the Codex CLI
    configIssues involving config.toml, config keys, config merging, or config updates
    contextIssues related to context management (including compaction)
    on May 10, 2026
  2. github-actions commented on May 10, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIbugSomething isn't workingconfigIssues involving config.toml, config keys, config merging, or config updatescontextIssues related to context management (including compaction)

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions