Skip to content

[Bug]: account-unentitled gpt-5.6-sol/terra/luna are advertised as native models and relayed as 502 stream errors #2548

Description

@mushikingh

Client or integration

Claude Code

Area

Catalog / models

Summary

The static native catalog advertises gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna as selectable native OpenAI rows regardless of what the authenticated ChatGPT account's own model roster supports. On a free ChatGPT plan every request for these models is forwarded and rejected upstream with:

The 'gpt-5.6-sol' model is not supported when using Codex with a ChatGPT account.

OpenCodex relays this as a 502 (upstream_server_error), which Claude Code surfaces as 502 upstream stream ended before a terminal frame (truncated response) and then retries 10 times. The user-visible symptom blames the stream/truncation, while the real cause is an entitlement gap: the picker offers models the account cannot use.

This is the same class as #2097, which added per-account roster gating for gpt-daybreak-blue-latest (ACCOUNT_GATED_NATIVE_OPENAI_MODELS). That gate currently contains only Daybreak; the GPT-5.6 family needs the same treatment (they are absent from a free account's authenticated /models roster).

Expected: account-gated native models are only advertised (Claude gateway discovery, Codex catalog, management rows) and routed when the authenticated account's roster confirms them; otherwise they are hidden or fail closed before dispatch.

Reproduction

  1. Log in with a free ChatGPT account (codex login); ocx provider test openai reports connected (forward auth).
  2. Launch Claude Code through the proxy: ocx claude --model claude-ocx-native--gpt-5.6-sol.
  3. Send any prompt.
  4. Observe the retry loop: ✻ 502 upstream stream ended before a terminal frame (truncated response) · Retrying in 2s · attempt 4/10.
  5. Check ~/.opencodex/usage.jsonl: each attempt records status: 502, errorCode: upstream_server_error, upstreamError: The 'gpt-5.6-sol' model is not supported when using Codex with a ChatGPT account.
  6. ocx account refresh openai shows the account plan is free.

Consistently reproducible. gpt-5.6-luna and gpt-5.6-terra are expected to behave the same (all three ship in the static native list and none appear in a free account's roster).

Version

2.32.1

Operating system

Ubuntu 24.04 (WSL2)

Provider and model

openai (ChatGPT login, authMode: forward, codexAccountMode: direct) / gpt-5.6-sol (also expect gpt-5.6-terra, gpt-5.6-luna)

Logs or error output

$ tail -n 40 ~/.opencodex/usage.jsonl | jq -r 'select(.surface=="claude") | [.status,.provider,.requestedModel,.errorCode,.upstreamError] | @tsv'
502  openai  gpt-5.6-sol  upstream_server_error  The 'gpt-5.6-sol' model is not supported when using Codex with a ChatGPT account.
502  openai  gpt-5.6-sol  upstream_server_error  The 'gpt-5.6-sol' model is not supported when using Codex with a ChatGPT account.
502  openai  gpt-5.6-sol  upstream_server_error  The 'gpt-5.6-sol' model is not supported when using Codex with a ChatGPT account.
...repeats for every retry attempt

Claude Code side:

✻ 502 upstream stream ended before a terminal frame (truncated response) · Retrying in 2s · attempt 4/10

Redacted configuration

{
  "providers": {
    "openai": {
      "adapter": "openai-responses",
      "baseUrl": "https://chatgpt.com/backend-api/codex",
      "authMode": "forward",
      "codexAccountMode": "direct"
    }
  }
}

Suggested fix direction

Extend the #2097 mechanism: add gpt-5.6-sol, gpt-5.6-terra, and gpt-5.6-luna to ACCOUNT_GATED_NATIVE_OPENAI_MODELS (src/codex/catalog/native-models.ts) so catalog generation, Claude gateway discovery, management rows, and Pool/Direct routing all require the authenticated per-account /models roster before advertising or dispatching them. I have a local patch along these lines (with updated tests across entitlement/catalog/convergence/auth suites) and can open a PR after review.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

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

    account-poolOAuth, credentials, Codex pool, quota, failover, plansbugSomething isn't workingcatalogModel catalog, slugs, visibility, routed entrieslanded-via-maintainerOriginal PR closed after landing via a maintainer merge trainstreamingSSE, WebSocket, terminal stream frames

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions