ISSUE DESCRIPTION Stale 'clientversion' fallback causes 503 'noplansupportformodel' for…
- User
ISSUE DESCRIPTION
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
- Run
Assistant
Let me start by understanding the repository structure and the issue. The issue is about a stale
client_versionfallback inapp/core/clients/codex_version.pythat causes 503 errors when GitHub releases API is rate-limited. Let me explore the repository first.Let me understand the issue:
codex_version.pytries to fetch the latest codex release from GitHub API- When rate-limited (HTTP 403), it falls back to settings default
0.101.0 - This old version causes the model registry to not include newer models like
gpt-5.5 - The suggested fix includes adding a secondary version source like npm registry
Let me explore the codebase to understand the structure and then implement a fix.
Assistant
Let me look at the specific file mentioned in the issue:
app/core/clients/codex_version.py.Assistant
Let me examine the key files related to the issue:
Assistant
The open command might need a different format. Let me try the proper command format.
Assistant
Let me read the key files directly.
Assistant
Now let me look at the settings file and model fetcher to understand the full flow.
Assistant
Now let me look at the model fetcher and how the version is used.
Assistant
Now I have a clear picture. Let me also check the model_refresh_scheduler.py quickly
Assistant
Now I have a complete understanding of the issue. Let me implement the fix. I'll add a secondary version source (npm registry) as a fallback when GitHub API fails. Let me also look at the tests to see if there are any related tests.
Assistant
Let me look at the existing test for codex_version to understand the test patterns:
Assistant
Now I have a complete understanding. Let me implement the fix. I'll modify
codex_version.pyto add npm registry as a secondary version source when GitHub API fails.Assistant
Now I'll implement the fix. I'll modify
codex_version.pyto add npm registry as a fallback version source:Assistant
Good. Now let me replace the actual file with the updated version:
Assistant
Let me verify the updated file and run the existing tests:
Assistant
Now let me run the existing tests to verify everything still passes:
Assistant
Let me install the required dependencies first:
Assistant
Let me also install test dependencies:
Assistant
Now let me run the tests:
Assistant
All existing tests pass. Let me also run the model fetcher and model refresh scheduler tests:
Assistant
All existing tests pass. Now let me create a quick test to verify the npm fallback works correctly:
Assistant
All tests pass. Let me also run the broader unit test suite to make sure nothing else is broken:
Assistant
All 1889 tests passed. Let me clean up and verify the final state of my change:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.