-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Codex context override can fall back to 272k after 2026.6.1 OpenAI route unification #90448
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.Auth, provider routing, model choice, or SecretRef resolution may break.impact:data-lossCan lose, corrupt, or silently drop user/session/config data.Can lose, corrupt, or silently drop user/session/config data.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
After the OpenAI/Codex route unification in 2026.6.1, a 5.28-era Codex context override can be lost:
openai/gpt-5.5running through the Codex runtime no longer readsmodels.providers.openai-codex.models[].contextTokens, so sessions can fall back to the Codex runtime default272000instead of the configured ~1M cap.This looks like a regression of the behavior fixed in #77858 / #77861, not a general session-context preservation issue.
Real environment observed
openai/gpt-5.5withagentRuntime.id = "codex"models.providers.openai-codex.models[]:id: "gpt-5.5"contextTokens: 1050000A read-only config probe after the upgrade showed no
gpt-5.5context override under the canonicalmodels.providers.openai.models[]entry, so the 5.28-era override was not available to the 6.1 resolver.Why this matters
#77861 intentionally made native Codex runs honor Codex OAuth context overrides. Its real behavior proof used exactly this kind of setup:
openai/gpt-5.5models.providers.openai-codex.models[].contextTokens: 1000000/status/agentMeta.contextTokensaround1.0mIn 2026.6.1, OpenAI/Codex provider ids were unified. That is fine as a route/auth model, but legacy context-window metadata needs either migration or a compatibility fallback. Otherwise existing installs can silently lose their larger configured Codex context budget.
Source-level repro on current main
Current main resolves the context config provider for OpenAI routes to
openai:With a legacy 5.28-style config where the override still lives under
openai-codex, the current resolver misses it and returns the fallback/default:{ "models": { "providers": { "openai-codex": { "models": [ { "id": "gpt-5.5", "contextTokens": 1050000, "contextWindow": 400000 } ] }, "openai": { "models": [] } } } }Observed with a local probe on current main:
{"name":"cfgLegacy","contextConfigProvider":"openai","tokens":272000}If the same override is placed under canonical
models.providers.openai.models[], the resolver returns the expected cap:{"name":"cfgCanonical","contextConfigProvider":"openai","tokens":1050000}Expected behavior
Upgrading/repairing a 5.28-era config should preserve the effective Codex context cap for
openai/gpt-5.5 + codex runtime.Either of these would be reasonable:
models.providers.openai-codex.models[].contextTokens/contextWindowmetadata to the canonicalmodels.providers.openai.models[]entry; oropenai-codexcontext metadata when the canonicalopenaimodel entry has no explicit context override.Actual behavior
A legacy Codex override can be ignored after 6.1 provider unification, so the active budget can fall back to
272000.Scope / non-goals