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). - Add a secondary version source.
npm view @openai/codex versionagainsthttps://registry.npmjs.orgis not rate-limited the way the GitHub anonymous API is, and a static fetch ofhttps://registry.npmjs.org/@openai/codex/latestreturns JSON containing\"version\". - Cache the fetched version on disk (e.g. inside the data volume) so a single successful lookup survives container restarts and survives transient 403s for the cache TTL.
- Honor the client's own
client_versionquery string as a hint for which model list to refresh (only when greater than the configured default), so a newer client effectively bootstraps the registry.
Workaround
For anyone hitting this, pass
-e CODEX_LB_MODEL_REGISTRY_CLIENT_VERSION=<your-codex-cli-version>todocker run:docker run -d \\ -e CODEX_LB_DASHBOARD_BOOTSTRAP_TOKEN=... \\ -e CODEX_LB_MODEL_REGISTRY_CLIENT_VERSION=0.130.0 \\ -p 2455:2455 -p 1455:1455 \\ -v codex-lb-data:/var/lib/codex-lb \\ ghcr.io/soju06/codex-lb:1.17.0Environment
- codex-lb image:
ghcr.io/soju06/codex-lb:1.17.0 - Codex CLI:
@openai/codex@0.130.0 - Host: macOS, Docker Desktop / Colima
- Account plan:
pro(3 accounts, allplan_type=proinstore.db)
Related: #480 ("Model metadata for
gpt-5.5not found. Defaulting to fallback metadata") looks like the same underlying cause.Interface
No new interfaces are introduced.
- Run
- Assistant
I’m tracing the version-resolution and model-refresh paths first. Because this changes fallback behavior, I’ll use the repository’s OpenSpec workflow and project conventions, then implement and test the smallest robust fix.
- Assistant
The OpenSpec skills require artifacts before implementation; I’m fast-forwarding a focused change named
make-codex-version-fallback-resilient. The project-conventions skill also requires its full conventions reference before anyapp/edit. - Assistant
OpenSpec’s CLI is not installed on this checkout (
openspec: command not found), so its automated artifact scaffold cannot run. I’ll preserve the mandated workflow manually by matching an existing change’s proposal/spec/design/tasks structure, then validate with the repository’s available checks. - Assistant
Using change:
make-codex-version-fallback-resilient(spec-driven). The artifacts define four tasks; implementation will keep GitHub authoritative, consult npm only after a GitHub failure/invalid payload, and retain stale-cache/configured-default behavior if both fail. - Assistant
The first implementation pass is green: 13 focused tests plus lint/format checks pass. I’m adding one more regression for a transport exception (not just HTTP 403), then I’ll run the adjacent model-fetch tests and broader unit suite if time permits.
- Assistant
The adjacent model-refresh path is green (20 tests). The full unit suite is now running; after it completes I’ll reconcile the task checklist and perform a final diff/spec consistency review.
- Assistant
The full unit suite passes: 1,892 passed, 39 skipped, with four pre-existing warnings. Verification against the delta spec finds all three scenarios covered and all four tasks complete. OpenSpec CLI validation itself remains unavailable, so I’m using the documented manual sync/archive fallback to keep the main spec as SSOT.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- fable-5Compare side by side →
- fable-5Compare side by side →