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’m treating this as a behavior fix and will follow the repository’s OpenSpec workflow first, then implement and run the focused and spec validation tests. I’m also loading the project conventions because the change will touch code.
- Assistant
The issue is sufficiently specific, so I’m fast-forwarding a focused OpenSpec change named
avoid-stale-codex-version-fallbackthrough its required artifacts. Then I’ll apply that change directly. - Assistant
The local
openspecexecutable is not on PATH, so the OpenSpec skill cannot scaffold artifacts through its CLI as written. I’ll use the repository’s existing OpenSpec structure as the fallback, create the required change artifacts manually, and still validate with the project’s available test tooling. - Assistant
The selected fix is a secondary lookup against
registry.npmjs.org/@openai/codex/latest: GitHub remains primary, but a 403, malformed release, or transport failure will no longer immediately force the stale configured default. This directly covers the reported rate-limit failure without changing any public interface. - Assistant
OpenSpec artifacts are now in place. I’m applying the implementation task: isolate each source failure so a GitHub transport error—as well as HTTP or payload failure—still permits the npm lookup, while retaining the existing TTL cache and operator override fallback.
- Assistant
The new regression tests pass, and static typing is clean. Lint found one formatting-only issue in the fallback log line; I’m correcting that, then I’ll run the broader unit suite to catch interactions beyond version discovery.
- Assistant
The broader unit suite is still running; no failures have surfaced in the initial output.
- Assistant
The full unit suite passed: 1,892 passed and 39 skipped. The only warnings are pre-existing pytest/runtime warnings in unrelated bridge and health tests. I’m doing the final diff review and repository-wide lint now; OpenSpec CLI validation remains unavailable because the executable is not installed locally.
- Assistant
Because this fix adds OpenSpec documentation, I’m also applying the repository’s OpenSpec context policy before finalizing the task checklist. It will ensure the delta spec stays strictly testable and the rationale remains in the proposal.
- Assistant
Implementation and tests are complete. Per the repository workflow, I’m now performing the OpenSpec verification pass before deciding whether the change can be archived; the missing CLI may limit only the schema-validation portion, not the code/spec coherence review.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.