Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek/deepseek-v4-pro· deepseekHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION Stale 'clientversion' fallback causes 503 'noplansupportformodel' for…

  1. 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.py cannot fetch the latest codex release from api.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.0
    

    and falls back to Settings.model_registry_client_version (default 0.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_plans never gets a gpt-5.5 entry, _filter_accounts_for_model in modules/proxy/load_balancer.py:1168 returns an empty set, and every Codex request for gpt-5.5 is 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.0 and the account's ChatGPT subscription does support the model (calling /backend-api/codex/models?client_version=0.130.0 through the LB returns 200 with the model present).

    Reproduction

    1. Run ghcr.io/soju06/codex-lb:1.17.0 on a host where anonymous GitHub API requests are 403'ed.
    2. Connect a current Codex CLI (e.g. @openai/codex@0.130.0) configured with model = \"gpt-5.5\".
    3. Observe startup log line:
      • GitHub fetch failed and no cached version; falling back to settings default 0.101.0
    4. Every POST /backend-api/codex/responses returns 503 with code no_plan_support_for_model.

    Setting CODEX_LB_MODEL_REGISTRY_CLIENT_VERSION=0.130.0 and recreating the container fully resolves the symptom.

    Suggested fixes

    A few low-effort options, any one would help:

    1. Bump the baked-in default model_registry_client_version on each release so it tracks the recent @openai/codex version (or read it from a generated file at build time).
    2. Add a secondary version source. npm view @openai/codex version against https://registry.npmjs.org is not rate-limited the way the GitHub anonymous API is, and a static fetch of https://registry.npmjs.org/@openai/codex/latest returns JSON containing \"version\".
    3. 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.
    4. Honor the client's own client_version query 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> to docker 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.0
    

    Environment

    • 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, all plan_type=pro in store.db)

    Related: #480 ("Model metadata for gpt-5.5 not found. Defaulting to fallback metadata") looks like the same underlying cause.

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /codex-lb, current file: none) bash-$

  2. DeepSeek Assistant

    Let me start by understanding the repository structure and the issue. The problem is:

    1. When app/core/clients/codex_version.py cannot fetch the latest codex release from GitHub API (rate-limited with 403), it falls back to a hardcoded default 0.101.0
    2. This old version causes the model registry to miss newer models like gpt-5.5
    3. This results in 503 errors for those models

    The suggested fixes include:

    1. Bump the baked-in default model_registry_client_version
    2. Add a secondary version source (npm registry)
    3. Cache the fetched version on disk
    4. Honor the client's own client_version query string

    Let me explore the codebase first.

  3. DeepSeek Assistant

    Let me look at the key files mentioned in the issue

  4. DeepSeek Assistant

    Let me just run one command at a time.

  5. DeepSeek Assistant

    Let me read the key files: codex_version.py and model_fetcher.py

  6. DeepSeek Assistant

    Let me use the bash_terminal to cat the file.

  7. DeepSeek Assistant

    Now let me look at the model_fetcher.py and the settings.

  8. DeepSeek Assistant

    Now let me find the settings file to see the default value for model_registry_client_version.

  9. DeepSeek Assistant

    Let me look at the settings file to understand the configuration better

  10. DeepSeek Assistant

    Let me look for existing tests related to this functionality

  11. DeepSeek Assistant

    Let me search for tests related to codex_version specifically.

  12. DeepSeek Assistant

    Let me look at the unit test for codex_version

  13. DeepSeek Assistant

    Now I have a good understanding of the codebase. Let me look at the structure more closely and plan my implementation.

    The issue is clear:

    1. GitHub API rate-limits anonymous requests (403), causing fallback to 0.101.0
    2. This old version means upstream doesn't return newer models like gpt-5.5
    3. Leading to 503 errors

    My plan: Add npm registry as a secondary version source AND add disk caching so a successful lookup persists across container restarts. This addresses both options 2 and 3 from the suggested fixes.

    Let me first look at the directory structure to understand where to store the cache:

  14. DeepSeek Assistant

    Let me now implement the solution. I'll modify codex_version.py to add npm registry fallback and disk caching. Let me first check what's available for async file I/O:

  15. DeepSeek Assistant

    Now let me implement the changes. I'll modify codex_version.py to add npm registry fallback and disk caching.

  16. DeepSeek Assistant

    Now I'll implement the changes. Let me create the updated `codex_version

  17. DeepSeek Assistant

    Let me verify the file and then run the existing tests to see if they pass:

  18. DeepSeek Assistant

    Good. Now let me run the existing unit tests:

  19. DeepSeek Assistant

    Let me install the test dependencies:

  20. DeepSeek Assistant

    Let me check if there's a requirements file or if the project uses poetry/pipenv.

  21. DeepSeek Assistant

    Let me check pyproject.toml for test dependencies

  22. DeepSeek Assistant

    Let me check if there's a virtual environment

  23. DeepSeek Assistant

    Let me use the virtual environment to run the tests.

  24. DeepSeek Assistant

    I see the issue - the disk cache from other tests is polluting the results. Let me simplify the approach: just add npm registry as a secondary version source without disk caching. The npm registry is not rate-limited the way GitHub anonymous API is, so this alone solves the problem

  25. DeepSeek Assistant

    Now let me run the tests again:

  26. DeepSeek Assistant

    All 11 tests pass. Let me also run the related tests to make sure nothing is broken:

  27. DeepSeek Assistant

    Let me run all unit tests to make sure nothing else is broken:

  28. DeepSeek Assistant

    All 1889 unit tests passed with 0 failures. Let me now verify the npm registry endpoint works correctly in

  29. DeepSeek Assistant

    The npm registry returns "version": "0.144.5" which is a valid version string matching the regex pattern. Let me also clean up any disk cache file left from the earlier test runs:

  30. DeepSeek Assistant

    Let me run the codex_version tests once more to confirm everything is clean:

  31. DeepSeek Assistant

    All 11 tests pass. Let me verify the final state of the changed file:

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.