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 exploring the repository structure to understand the codebase.
Assistant
Now let me look at the configuration to find the
model_registry_client_versionsetting:Assistant
Now let me look at the model_fetcher and model_refresh_scheduler:
Assistant
Let me look at the load balancer and where the 503 response happens:
Assistant
Let me see the entire response logic:
Assistant
Let me look at the existing tests for codex_version:
Assistant
Now let me look at the test_model_refresh_scheduler:
Assistant
Let me look at the structure to understand more:
Assistant
Let me look at the model_registry:
Assistant
Now let me understand how settings are set up for testing:
Assistant
Now let me check what version we should bump the default to and look at the current version of codex:
Assistant
Let me look at the file structure and check how the data directory works:
Assistant
Now let me check the structure of encryption_key_file to understand how the data dir works:
Assistant
Now I have a clear plan. Let me implement the fix. I'll modify
codex_version.pyto:- Add a fallback to npm registry (less rate-limited)
- Add on-disk caching for persistence across restarts
- Bump the baked-in default
Let me first set up a reproduction script to confirm the issue:
Assistant
I've confirmed the issue. Now let me implement the fix:
Assistant
Let me check how tests are set up:
Assistant
Let me check how client_version is set on requests:
Assistant
Now I have a clear plan. Let me implement the changes to
codex_version.py:Assistant
I see the issue - the
_disk_path_resolved()falls back to_default_disk_path()even whendisk_path=Nonewas explicitly passed. Let me fix this:Assistant
Let me fix the disk path resolution:
Assistant
Let me fix the disk path resolution - the issue is that
_disk_path_resolvedfalls back to_default_disk_path()even whendisk_path=Nonewas explicitly passed.Assistant
Let me look at the file to see the actual content:
Assistant
Now let me run the tests again:
Assistant
All tests pass. Let me also run other tests that might be affected:
Assistant
Now let me create a reproduction script to verify the fix actually works:
Assistant
Excellent! All verification tests pass. Now let me simulate the exact scenario described in the issue:
Assistant
Let me run the full test suite to make sure nothing is broken:
Assistant
All 1889 unit tests pass. Let me also run the integration tests to be thorough:
Assistant
All tests pass. Let me clean up the temporary scripts:
Assistant
Let me view the final state of the file:
Assistant
Let me verify the singleton gets a valid disk path:
Assistant
Let me verify the disk path works correctly when in Docker:
Assistant
Let me view the final file:
Assistant
Let me run one more comprehensive test to make sure my changes don't break anything:
Assistant
All tests pass. Let me also do a final review of the implementation:
Assistant
Now let me do a final comprehensive verification:
Assistant
Let me run the entire test suite one final time to make sure everything passes:
Assistant
All 1889 unit tests pass. Let me also write a final verification script to confirm the fix resolves the issue from the bug report:
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.