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:codeGitHub 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:codeproxy_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:
- Run
- Assistant
I’ll trace the version-resolution and model-refresh paths, then create the required OpenSpec change before implementing and testing the fallback fix. I’m using the OpenSpec workflow skills and the project-conventions skill because this is a behavior change with code edits.
- Assistant
The repository’s search utility isn’t installed, so I’m switching to
find/grep. The working tree is clean, and I’ve reviewed the project’s typing, structure, and test conventions. - Assistant
The OpenSpec CLI is not installed in this checkout, so I can’t run its scaffold/status commands. I’ll preserve the required workflow manually by adding the standard proposal, delta spec, and task artifacts. The implementation choice is a GitHub-first, npm-registry-second lookup, retaining the existing stale-cache and configured-default behavior only after both sources fail.
- Assistant
The OpenSpec change is now defined as
add-codex-version-npm-fallback. I’m applying its first task: centralizing remote metadata fetch/validation so GitHub stays primary and npm is attempted only on failure. - Assistant
The resolver now tries npm only after GitHub returns an error, invalid payload, or raises an exception. Both sources use the same stable-version validation, and the existing TTL/stale/default layers remain unchanged. I’m adding regression tests for the reported 403 path and the all-sources-failed path.
- Assistant
The targeted suite passes (14 tests) and lint is clean. I’m moving to the repository-required verification and archive stage; I’ll use the OpenSpec verification/archive instructions, while noting that the local OpenSpec executable itself is unavailable.
- Assistant
Verification maps all three specified scenarios to explicit tests with no gaps: GitHub priority, GitHub 403 → npm success, and both sources failing → configured default. The delta adds one requirement to
outbound-http-clients; I’m syncing that requirement to the main spec before archiving, and using the repository’s context-doc policy for the rationale/failure example. - Assistant
Verification is clean: 4/4 tasks are satisfied, 1/1 requirement is implemented, and all 3 scenarios have direct coverage. The expanded model-refresh test set passes (19 tests), lint and whitespace checks pass, and the main spec/context are synced. The only unavailable gate is
openspec validate --specsbecause no OpenSpec binary is installed. - Assistant
The OpenSpec context policy influenced the final docs: normative behavior stays in
spec.md, while source rationale, cold-start failure behavior, a concrete 403 example, and operator guidance live incontext.md. I’m archiving the now-verified change as required by this repository’s workflow.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.