From ef1022e9c8946d36dfa13365fbaedba6c8fa0324 Mon Sep 17 00:00:00 2001 From: OmniRoute Ops Date: Mon, 11 May 2026 15:34:05 +0000 Subject: [PATCH] fix(registry): cap gpt-5.5 codex OAuth contextLength at 400K (not 1.05M) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The codex OAuth backend (chatgpt.com/backend-api/codex/responses) caps the gpt-5.5 context window at 400 000 tokens, not the 1 050 000 advertised by the public OpenAI API. Clients reading /v1/models for prompt-budget math (e.g. Capy computing compression thresholds) would otherwise allow prompts beyond the OAuth backend's actual capacity, triggering silent truncation or upstream 400s. Per-entry override of GPT_5_5_CODEX_CAPABILITIES (which spreads contextLength=1050000 from the shared constant) — the constant itself is unchanged because it's also consumed by the github provider's gpt-5.5 entry where DB sync provides the canonical 400K/128K values. max_output_tokens=128000 is informational only — the codex OAuth backend strips max_output_tokens server-side (LiteLLM and Codex CLI both confirm this). Advertising a realistic value still helps clients that read it for token-budget heuristics. References : - openai/codex#19208 "1M context window gone after GPT-5.5 release" - openai/codex#19319 — 258 400 effective context window observation - openai/codex#19464 — Support 1M for GPT-5.5 in Codex (feature ask) - opencode#24171 — GPT-5.5 Codex 400K vs API 1M - BerriAI/litellm#21193 — codex backend rejects unsupported params - openai/codex#4138 — model_max_output_tokens not wired up Co-Authored-By: Claude Opus 4.7 (1M context) --- open-sse/config/providerRegistry.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/open-sse/config/providerRegistry.ts b/open-sse/config/providerRegistry.ts index 8b6bb51cef..8d55e95c57 100644 --- a/open-sse/config/providerRegistry.ts +++ b/open-sse/config/providerRegistry.ts @@ -462,11 +462,15 @@ export const REGISTRY: Record = { tokenUrl: "https://auth.openai.com/oauth/token", }, models: [ - { id: "gpt-5.5", name: "GPT 5.5", ...GPT_5_5_CODEX_CAPABILITIES }, - { id: "gpt-5.5-xhigh", name: "GPT 5.5 (xHigh)", ...GPT_5_5_CODEX_CAPABILITIES }, - { id: "gpt-5.5-high", name: "GPT 5.5 (High)", ...GPT_5_5_CODEX_CAPABILITIES }, - { id: "gpt-5.5-medium", name: "GPT 5.5 (Medium)", ...GPT_5_5_CODEX_CAPABILITIES }, - { id: "gpt-5.5-low", name: "GPT 5.5 (Low)", ...GPT_5_5_CODEX_CAPABILITIES }, + // gpt-5.5 codex OAuth backend caps context at 400K (not the public-API + // 1.05M). Public refs : openai/codex#19208, #19319, #19464 ; + // opencode#24171. max_output_tokens is stripped server-side + // (litellm#21193, codex#4138) so 128K is informational only. + { id: "gpt-5.5", name: "GPT 5.5", ...GPT_5_5_CODEX_CAPABILITIES, contextLength: 400000, maxOutputTokens: 128000 }, + { id: "gpt-5.5-xhigh", name: "GPT 5.5 (xHigh)", ...GPT_5_5_CODEX_CAPABILITIES, contextLength: 400000, maxOutputTokens: 128000 }, + { id: "gpt-5.5-high", name: "GPT 5.5 (High)", ...GPT_5_5_CODEX_CAPABILITIES, contextLength: 400000, maxOutputTokens: 128000 }, + { id: "gpt-5.5-medium", name: "GPT 5.5 (Medium)", ...GPT_5_5_CODEX_CAPABILITIES, contextLength: 400000, maxOutputTokens: 128000 }, + { id: "gpt-5.5-low", name: "GPT 5.5 (Low)", ...GPT_5_5_CODEX_CAPABILITIES, contextLength: 400000, maxOutputTokens: 128000 }, { id: "gpt-5.4", name: "GPT 5.4", targetFormat: "openai-responses" }, { id: "gpt-5.4-mini", name: "GPT 5.4 Mini", targetFormat: "openai-responses" }, { id: "gpt-5.3-codex-spark", name: "GPT 5.3 Codex Spark" },