fix(codex): prefer max_context_window over context_window as the usable input limit - #11179
Merged
diegosouzapw merged 2 commits intoAug 23, 2026
Conversation
This was referenced Aug 23, 2026
Contributor
Author
|
Second commit (8520787) — the parser fix alone was insufficient: the conservative discovery merge ( |
diegosouzapw
merged commit Aug 23, 2026
7af14d2
into
diegosouzapw:release/v3.8.50
9 of 16 checks passed
This was referenced Aug 23, 2026
jonlwheat2-gif
added a commit
to jonlwheat2-gif/OmniRoute
that referenced
this pull request
Aug 24, 2026
) i18nUiCoverage ratchet read 99.4 vs baseline 100: recent merges (diegosouzapw#11166/diegosouzapw#11178/diegosouzapw#11179/diegosouzapw#11224/diegosouzapw#11227/diegosouzapw#11283) shipped new UI keys without mirroring them into the 41 non-en catalogs. Fill via the documented EN- fallback convention (scripts/i18n/fill-missing-from-en.mjs semantics: absent keys only, never overwrite) so every locale reaches parity; translations can be refined in place later without touching code.
muhamadgalihsaputra
pushed a commit
to niyatna/NiyatnaRoute
that referenced
this pull request
Sep 27, 2026
…le input limit (diegosouzapw#11179) Validated on the combined batch board over tip e8ec7cb: static gates clean (changelog, file-size 160 frozen, complexity 2628<=2774, cognitive 1187<=1223, dead-code 408<=416, docs-counts green at 351 providers, provider-consistency 268/351/0), typecheck:core clean, 430+ focused tests green across 5 groups. max_context_window now wins over the pricing-tier context_window in Codex catalog parsing — context-aware fallback stops demoting codex behind smaller targets. Live evidence (390K served past 272K) plus the live-shape regression test. Thank you @excessivechaos!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The live Codex OAuth catalog reports BOTH
context_window(~272K) andmax_context_window(~872K). The discovery parser'sfirstPositiveNumberchain readscontext_windowfirst, so every GPT-5.6 model resolves to a 272K input limit even though 272K is only the first pricing tier — the real usable window ismax_context_window(872K).Evidence that 272K is not a hard window:
gpt-5.6-luna-xhighserved 380-390K input tokens with HTTP 200 (call_logs, 2026-08-20 02:45-02:48) while the 922K override was active — well past 272K with no context-overflow errors.Consequence: the context-aware combo fallback treats codex as too-small for large conversations and reorders it behind 1M-context targets, defeating the declared priority order.
Fix
Reorder
firstPositiveNumbersomax_context_windowwins overcontext_windowwhen both are present;context_windowremains the fallback for catalogs that omit the max.Verification
context_window: 272000+max_context_window: 872000) resolvesinputTokenLimit: 872000.gpt-5.6-luna→ 872000.git diff --checkclean.Live payload keys verified directly against
https://chatgpt.com/backend-api/codex/modelswith the account OAuth token (slug + context_window + max_context_window).