fix: cap GPT-5.6 ChatGPT sessions at the Codex 272k input budget - #10827
Conversation
Codex CLI 0.145.0 lists 272k for Sol, Terra, and Luna — the same as GPT-5.5. The old 372k/500k split delayed compaction until the unofficial backend rejected the turn.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Give the large-window Codex fixture the real 128k output budget so the displayed subscription window stays 400k.
FindingsDiff is small and clean — no issues to flag. This is a straightforward bug fix in Checked against the review checklist:
The underlying factual claim (Codex CLI 0.145.0's Verified
|
Summary
ChatGPT-subscription sessions on GPT-5.6 Sol, Terra, and Luna now use the same Codex budget as GPT-5.5: 272k input, 400k displayed context (input plus the registry 128k output). Compaction and the status bar follow those numbers instead of the old 372k / 500k split.
Codex CLI 0.145.0 lists
context_windowandmax_context_windowas 272000 for all three GPT-5.6 variants. OpenCode matched that today in anomalyco/opencode#39082. Our larger GPT-5.6-only cap let sessions run past the window the first-party harness advertises; the unofficial Codex backend then rejected the turn without a recoverable overflow error.API-key and relay routes are unchanged. They still use the llm-zoo 1.05M window.
Issue acceptance gates
No tracking issue. Acceptance:
272k + model.maxOutputTokens, not a second hardcoded GPT-5.6 constantSingle source of truth
src/model/providerCapabilities.ts—CODEX_DEFAULT_SUBSCRIPTION_INPUT_LIMIT(272k). Displayed context is that input cap plus the model's registrymaxOutputTokens.Duplication and abstraction budget
Removed
codexSubscriptionTokenLimitsand the GPT-5.6-only 500k / 372k constants. One budget for every ChatGPT-subscription model.Net elements (R6)
n/a — bug fix, not a refactor PR.
Consumer counts (R8)
n/a — deleted file-local helper and two exports that only this module and its suite consumed.
Host impact
Extension: model picker and progress context use the smaller subscription window on ChatGPT auth.
Desktop: same shared profile.
CLI: status bar for GPT-5.6 subscription usage shows
187k/400kinstead of187k/500k.Scheduled refactoring
None. A 1M ChatGPT-account opt-in is deliberately not added; Codex still clamps Sol to the catalog 272k max.
Validation
npx vitest run src/test-kernel/model/ProviderCapabilities.vitest.ts src/test-kernel/cli/StatusBar.vitest.ts src/test-kernel/model/ComputeModelOptions.vitest.ts src/test-kernel/agent/modelHandlers/CodexSubscriptionFallback.vitest.tsPost-audit fallback correction: 144 focused tests passed; workspace/test-kernel typechecks, full lint, Prettier, and diff checks passed.