Stale 'clientversion' fallback causes 503 'noplansupportformodel' for newer models (e.g.…
- User
Stale 'client_version' fallback causes 503 'no_plan_support_for_model' for newer models (e.g. gpt-5.5) when GitHub releases API rate-limits
Summary
When
app/core/clients/codex_version.pycannot fetch the latest codex release fromapi.github.com/repos/openai/codex/releases/latest(e.g. anonymous-rate-limited with HTTP 403), it logs:GitHub releases API returned HTTP 403 GitHub fetch failed and no cached version; falling back to settings default 0.101.0and falls back to
Settings.model_registry_client_version(default0.101.0). The model registry refresh (app/core/openai/model_refresh_scheduler.py→clients/model_fetcher.fetch_models_for_plan) then asks upstream/codex/models?client_version=0.101.0. Upstream gates newer model slugs behind newer client versions, so the response excludes e.g.gpt-5.5.As a result,
ModelRegistry.model_plansnever gets agpt-5.5entry,_filter_accounts_for_modelinmodules/proxy/load_balancer.py:1168returns an empty set, and every Codex request forgpt-5.5is rejected with:proxy_error_response status=503 code=no_plan_support_for_model message=No accounts with a plan supporting model 'gpt-5.5'…even though the actual Codex CLI is on
0.130.0and the account's ChatGPT subscription does support the model (calling/backend-api/codex/models?client_version=0.130.0through the LB returns 200 with the model present).Reproduction
- Run
ghcr.io/soju06/codex-lb:1.17.0on a host where anonymous GitHub API requests are 403'ed. - Connect a current Codex CLI (e.g.
@openai/codex@0.130.0) configured withmodel = \"gpt-5.5\". - Observe startup log line:
GitHub fetch failed and no cached version; falling back to settings default 0.101.0
- Every
POST /backend-api/codex/responsesreturns 503 with codeno_plan_support_for_model.
Setting
CODEX_LB_MODEL_REGISTRY_CLIENT_VERSION=0.130.0and recreating the container fully resolves the symptom.Suggested fixes
A few low-effort options, any one would help:
- Bump the baked-in default
model_registry_client_versionon each release so it tracks the recent@openai/codexversion (or read it from a generated file at build time).
- Run
- Assistant
I’ll trace the version-resolution path and its existing specs/tests, then create the required OpenSpec change before implementing and validating the fix. I’m using the project-conventions and OpenSpec workflow skills because this is a behavior change in this repository.
- Assistant
The “new change” helper is intentionally interactive, while your request explicitly asks for an end-to-end implementation. I’m switching to the fast-forward OpenSpec workflow so I can create the required artifacts and proceed without pausing.
- Assistant
The focused fix will add npm’s package metadata endpoint as a secondary authoritative source: GitHub remains primary, npm is tried on GitHub HTTP/transport/validation failure, then the existing stale-cache/configured fallback behavior remains unchanged. This directly covers the rate-limit failure without changing request interfaces.
- Assistant
The repository’s
openspecCLI is not installed in this environment, so the workflow helper cannot scaffold or validate artifacts. I’ll preserve the required OpenSpec-first structure manually, following the repository’s existing artifact format, and continue with local code/tests. - Assistant
The OpenSpec change is now defined at
add-codex-version-npm-fallback; implementation is scoped to version discovery plus regression tests. I’m applying the project conventions by keeping the source ordering explicit and retaining one canonical configured fallback. - Assistant
The regression is passing: a GitHub 403 now yields npm’s
0.130.0, and all existing stale-cache/configured-default cases still pass. I’ll now run the broader unit suite and inspect the final diff before marking the OpenSpec tasks verified. - Assistant
The full unit suite is green (
1890 passed, 39 skipped); the only warnings are pre-existing test warnings. The OpenSpec CLI is genuinely absent (including the project virtualenv), so I’m doing the required spec sync and verification manually and will record that validation limitation accurately. - Assistant
The context-doc policy affects this step: I’m keeping the normative fallback contract in
spec.mdand placing rationale, constraints, failure modes, and an example in a separatecontext.md. - Assistant
Manual verification is clean: 4/4 tasks complete, the single requirement is implemented, and all three scenarios map to passing tests (403→npm, dual failure→stale cache, dual failure→configured default). The main spec is synced; I’m archiving the verified change per repository policy.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.