Skip to content

Retry automatically when the selected model is at capacity #32020

Open

Description

@cowwoc

What version of Codex CLI is running?

codex-cli 0.144.1

What subscription do you have?

Pro 20x

Which model were you using?

gpt-5.6-luna

What platform is your computer?

Linux 6.18.33.2-microsoft-standard-WSL2 x86_64 unknown

What terminal emulator and version are you using (if applicable)?

Windows Terminal

Codex doctor report

{
  "schemaVersion": 1,
  "generatedAt": "1783657139s since unix epoch",
  "overallStatus": "warning",
  "codexVersion": "0.144.1",
  "checks": {
    "app_server.status": {
      "id": "app_server.status",
      "category": "app-server",
      "status": "ok",
      "summary": "background server is not running",
      "details": {
        "control socket": "/home/node/.codex/app-server-control/app-server-control.sock",
        "daemon state dir": "/home/node/.codex/app-server-daemon",
        "mode": "ephemeral",
        "pid file": "/home/node/.codex/app-server-daemon/app-server.pid (missing)",
        "settings": "/home/node/.codex/app-server-daemon/settings.json (missing)",
        "status": "not running",
        "update-loop pid file": "/home/node/.codex/app-server-daemon/app-server-updater.pid (missing)"
      },
      "remediation": null,
      "durationMs": 0
    },
    "auth.credentials": {
      "id": "auth.credentials",
      "category": "auth",
      "status": "ok",
      "summary": "auth is configured",
      "details": {
        "auth file": "/home/node/.codex/auth.json",
        "auth storage mode": "File",
        "stored API key": "false",
        "stored ChatGPT tokens": "true",
        "stored agent identity": "false",
        "stored auth mode": "chatgpt"
      },
      "remediation": null,
      "durationMs": 0
    },
    "config.load": {
      "id": "config.load",
      "category": "config",
      "status": "ok",
      "summary": "config loaded",
      "details": {
        "CODEX_HOME": "/home/node/.codex",
        "config.toml": "/home/node/.codex/config.toml",
        "config.toml parse": "ok",
        "cwd": "/workspace",
        "enabled feature flags": "shell_tool, unified_exec, shell_snapshot, code_mode_host, terminal_resize_reflow, sqlite, hooks, enable_request_compression, multi_agent, apps, tool_search_always_defer_mcp_tools, tool_suggest, plugins, in_app_browser, browser_use, browser_use_full_cdp_access, browser_use_external, computer_use, remote_plugin, plugin_sharing, image_generation, resize_all_images, skill_mcp_dependency_install, mentions_v2, steer, guardian_approval, goals, collaboration_modes, tool_call_mcp_elicitation, auth_elicitation, personality, fast_mode, tui_app_server, remote_compaction_v2, workspace_dependencies",
        "feature flag overrides": "none",
        "feature flags enabled": "35",
        "log dir": "/home/node/.codex/log",
        "mcp servers": "2",
        "model": "gpt-5.6-luna",
        "model provider": "openai",
        "sqlite home": "/home/node/.codex"
      },
      "remediation": null,
      "durationMs": 0
    },
    "git.environment": {
      "id": "git.environment",
      "category": "git",
      "status": "ok",
      "summary": "git version 2.47.3",
      "details": {
        ".git entry": "directory",
        "PATH git #1": "/usr/bin/git",
        "PATH git #2": "/bin/git",
        "PATH git entries": "2",
        "git branch": "v2.1",
        "git build options": "git version 2.47.3; cpu: x86_64; no commit associated with this build; sizeof-long: 8; sizeof-size_t: 8; shell-path: /bin/sh; libcurl: 8.14.1; zlib: 1.3.1",
        "git exec path": "/usr/lib/git-core",
        "git version": "git version 2.47.3",
        "repo detected": "true",
        "repo root": "/workspace",
        "selected git": "/usr/bin/git"
      },
      "remediation": null,
      "durationMs": 36
    },
    "installation": {
      "id": "installation",
      "category": "install",
      "status": "ok",
      "summary": "installation looks consistent",
      "details": {
        "PATH codex #1": "/usr/local/bin/codex",
        "PATH codex #2": "/usr/local/share/npm-global/bin/codex",
        "PATH codex entries": "2",
        "current executable": "/usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex",
        "install context": "npm (package /usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl, bin /usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin, resources /usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-resources, path /usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-path)",
        "managed by bun": "false",
        "managed by npm": "true",
        "managed by pnpm": "false",
        "managed package root": "/usr/local/share/npm-global/lib/node_modules/@openai/codex",
        "npm update target": "/usr/local/share/npm-global/lib/node_modules/@openai/codex"
      },
      "remediation": null,
      "durationMs": 113
    },
    "mcp.config": {
      "id": "mcp.config",
      "category": "mcp",
      "status": "ok",
      "summary": "MCP configuration is locally consistent",
      "details": {
        "configured servers": "2",
        "disabled servers": "0",
        "stdio servers": "1",
        "streamable_http servers": "1"
      },
      "remediation": null,
      "durationMs": 102
    },
    "network.env": {
      "id": "network.env",
      "category": "network",
      "status": "ok",
      "summary": "network-related environment looks readable",
      "details": {
        "proxy env vars": "none"
      },
      "remediation": null,
      "durationMs": 0
    },
    "network.provider_reachability": {
      "id": "network.provider_reachability",
      "category": "reachability",
      "status": "ok",
      "summary": "active provider endpoints are reachable over HTTP",
      "details": {
        "ChatGPT base URL": "https://chatgpt.com/backend-api/ reachable (HTTP 404)",
        "reachability mode": "ChatGPT auth"
      },
      "remediation": null,
      "durationMs": 149
    },
    "network.websocket_reachability": {
      "id": "network.websocket_reachability",
      "category": "websocket",
      "status": "ok",
      "summary": "Responses WebSocket handshake succeeded",
      "details": {
        "DNS": "2 IPv4, 2 IPv6, first IPv4",
        "auth mode": "chatgpt",
        "connect timeout": "15000 ms",
        "endpoint": "wss://chatgpt.com/backend-api/<redacted>",
        "handshake result": "HTTP 101 Switching Protocols",
        "model provider": "openai",
        "models etag present": "true",
        "provider name": "OpenAI",
        "proxy env vars": "none",
        "reasoning header": "false",
        "server model present": "false",
        "supports websockets": "true",
        "wire API": "responses"
      },
      "remediation": null,
      "durationMs": 602
    },
    "runtime.provenance": {
      "id": "runtime.provenance",
      "category": "runtime",
      "status": "ok",
      "summary": "running npm on linux-x86_64",
      "details": {
        "commit": "unknown",
        "current executable": "/usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin/codex",
        "install method": "npm (package /usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl, bin /usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/bin, resources /usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-resources, path /usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-path)",
        "platform": "linux-x86_64",
        "version": "0.144.1"
      },
      "remediation": null,
      "durationMs": 0
    },
    "runtime.search": {
      "id": "runtime.search",
      "category": "search",
      "status": "ok",
      "summary": "search is OK (bundled)",
      "details": {
        "search command": "/usr/local/share/npm-global/lib/node_modules/@openai/codex/node_modules/@openai/codex-linux-x64/vendor/x86_64-unknown-linux-musl/codex-path/rg",
        "search command readiness": "file exists",
        "search provider": "bundled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "sandbox.helpers": {
      "id": "sandbox.helpers",
      "category": "sandbox",
      "status": "ok",
      "summary": "sandbox configuration is readable",
      "details": {
        "approval policy": "Never",
        "codex-linux-sandbox helper": "/home/node/.codex/tmp/arg0/codex-arg0gggXSg/codex-linux-sandbox",
        "execve wrapper helper": "/home/node/.codex/tmp/arg0/codex-arg0gggXSg/codex-execve-wrapper",
        "filesystem sandbox": "unrestricted",
        "network sandbox": "enabled"
      },
      "remediation": null,
      "durationMs": 0
    },
    "state.paths": {
      "id": "state.paths",
      "category": "state",
      "status": "ok",
      "summary": "state paths and databases are inspectable",
      "details": {
        "CODEX_HOME": "/home/node/.codex (dir)",
        "active rollout files": "5642 files, 10282597933 total bytes, 1822509 average bytes",
        "archived rollout files": "0 files, 0 total bytes, 0 average bytes",
        "goals DB": "/home/node/.codex/goals_1.sqlite (file)",
        "goals DB integrity": "ok",
        "log DB": "/home/node/.codex/logs_2.sqlite (file)",
        "log DB integrity": "ok",
        "log dir": "/home/node/.codex/log (dir)",
        "memories DB": "/home/node/.codex/memories_1.sqlite (file)",
        "memories DB integrity": "ok",
        "sqlite home": "/home/node/.codex (dir)",
        "state DB": "/home/node/.codex/state_5.sqlite (file)",
        "state DB integrity": "ok"
      },
      "remediation": null,
      "durationMs": 2031
    },
    "state.rollout_db_parity": {
      "id": "state.rollout_db_parity",
      "category": "threads",
      "status": "warning",
      "summary": "rollout files and state DB thread inventory differ",
      "details": {
        "default model provider": "openai",
        "rollout DB active files": "5641",
        "rollout DB active rows": "5642",
        "rollout DB archive mismatches": "0",
        "rollout DB archived files": "0",
        "rollout DB archived rows": "0",
        "rollout DB duplicate DB paths": "0",
        "rollout DB duplicate rollout thread ids": "0",
        "rollout DB malformed file names": "1",
        "rollout DB malformed file sample": "/home/node/.codex/sessions/2026/06/22/rollout-2026-06-22T12-03-52-slice-019ee589-874b-7ab3-93d5-7869dcf63383.jsonl",
        "rollout DB missing active rows": "150",
        "rollout DB missing active sample": [
          "/home/node/.codex/sessions/2026/05/10/rollout-2026-05-10T17-02-36-019e13b2-f6ea-74a3-9e21-83c212334986.jsonl",
          "/home/node/.codex/sessions/2026/05/10/rollout-2026-05-10T17-03-11-019e13b3-8140-7990-8fc6-e6a830763665.jsonl",
          "/home/node/.codex/sessions/2026/05/10/rollout-2026-05-10T07-24-21-019e11a1-917a-7c33-a4ad-dde2c002eb03.jsonl",
          "/home/node/.codex/sessions/2026/05/10/rollout-2026-05-10T07-59-13-019e11c1-7b8f-7822-8c5b-44b295c032ea.jsonl",
          "/home/node/.codex/sessions/2026/05/10/rollout-2026-05-10T08-00-46-019e11c2-e777-7af1-9df3-2aa26a740269.jsonl"
        ],
        "rollout DB missing archived rows": "0",
        "rollout DB model providers": "openai=5628, headroom=14",
        "rollout DB rows": "5642",
        "rollout DB scan cap reached": "false",
        "rollout DB scan errors": "0",
        "rollout DB sources": "subagent:thread_spawn=3173, exec=1867, cli=600, vscode=2",
        "rollout DB stale row sample": [
          "/home/node/.config/codex/sessions/2026/03/30/rollout-2026-03-30T16-29-26-019d406f-dd12-7663-82d5-2028d5606386.jsonl",
          "/home/node/.config/codex/sessions/2026/03/30/rollout-2026-03-30T16-37-17-019d4077-0dff-7103-977b-2dba26f5e24f.jsonl",
          "/home/node/.config/codex/sessions/2026/03/30/rollout-2026-03-30T16-38-48-019d4078-72ad-7270-8e2a-253266f38b5d.jsonl",
          "/home/node/.config/codex/sessions/2026/03/30/rollout-2026-03-30T16-39-16-019d4078-ddea-7000-88c5-48980bbce297.jsonl",
          "/home/node/.config/codex/sessions/2026/03/30/rollout-2026-03-30T16-50-40-019d4083-4e5a-71e0-bf36-f6af1701d4f4.jsonl"
        ],
        "rollout DB stale rows": "150"
      },
      "issues": [
        {
          "severity": "warning",
          "cause": "rollout files are missing from the state DB",
          "measured": "150 active, 0 archived",
          "expected": "every rollout file has a matching threads row",
          "remedy": null,
          "fields": []
        },
        {
          "severity": "warning",
          "cause": "state DB rows point at missing or unusable rollout files",
          "measured": "150 stale rows",
          "expected": "every state DB rollout path is a file on disk",
          "remedy": null,
          "fields": []
        },
        {
          "severity": "warning",
          "cause": "rollout scan was incomplete or found bad files",
          "measured": "0 scan errors, 1 malformed names, scan cap reached: false",
          "expected": "rollout directories are fully scannable",
          "remedy": "Check file permissions and unexpected files under CODEX_HOME sessions.",
          "fields": []
        }
      ],
      "remediation": null,
      "durationMs": 285676
    },
    "system.environment": {
      "id": "system.environment",
      "category": "system",
      "status": "ok",
      "summary": "OS language unavailable",
      "details": {
        "EDITOR": "set",
        "VISUAL": "set",
        "os": "Debian 13.0.0 [64-bit]",
        "os language": "unavailable",
        "os type": "Debian",
        "os version": "13.0.0"
      },
      "remediation": null,
      "durationMs": 1
    },
    "terminal.env": {
      "id": "terminal.env",
      "category": "terminal",
      "status": "ok",
      "summary": "terminal metadata was detected",
      "details": {
        "COLORTERM": "truecolor",
        "DISPLAY": "present",
        "TERM": "xterm-direct",
        "WAYLAND_DISPLAY": "present",
        "color output": "enabled",
        "stderr is terminal": "true",
        "stdin is terminal": "true",
        "stdout is terminal": "true",
        "terminal": "unknown",
        "terminal size": "252x67"
      },
      "remediation": null,
      "durationMs": 0
    },
    "terminal.title": {
      "id": "terminal.title",
      "category": "title",
      "status": "ok",
      "summary": "terminal title default",
      "details": {
        "terminal title activity": "true",
        "terminal title items": "activity, project-name",
        "terminal title project source": "git repo root",
        "terminal title project value": "workspace",
        "terminal title source": "default"
      },
      "remediation": null,
      "durationMs": 0
    },
    "updates.status": {
      "id": "updates.status",
      "category": "updates",
      "status": "ok",
      "summary": "update configuration is locally consistent",
      "details": {
        "cached latest version": "0.143.0",
        "check for update on startup": "true",
        "last checked at": "2026-07-09T15:07:32.771219253Z",
        "latest version": "0.144.1",
        "latest version status": "current version is not older",
        "npm update target": "/usr/local/share/npm-global/lib/node_modules/@openai/codex",
        "update action": "npm install -g @openai/codex",
        "version cache": "/home/node/.codex/version.json"
      },
      "remediation": null,
      "durationMs": 665
    }
  }
}

What issue are you seeing?

While running a long operation codex aborts with the following error:

⚠ Selected model is at capacity. Please try a different model.

What steps can reproduce the bug?

Uploaded thread: 019f49d4-ed4b-7503-8eaf-fb52d49d57db

What is the expected behavior?

I expect codex to enter a sleep/retry loop until model capacity frees up. The loop should allow for many retries so long-term operations (such as /goal) do not abort in the middle of the night.

Additional information

No response

Activity

  1. added
    enhancementNew feature or request
    CLIIssues related to the Codex CLI
    rate-limitsIssues related to rate limits, quotas, and token usage reporting
    on Jul 10, 2026
  2. github-actions commented on Jul 10, 2026

    @github-actions
    Contributor

    Potential duplicates detected. Please review them and close your issue if it is a duplicate.

    Powered by Codex Action

  3. praveenperera commented on Jul 13, 2026

    @praveenperera
  4. tylorsaling-source commented on Jul 28, 2026

    @tylorsaling-source

    Windows Desktop reproduction supporting automatic retry as a cross-client requirement.

    Codex Desktop 26.721.4979.0, using gpt-5.6-sol with high reasoning, ran a turn for ~25 minutes and then recorded server_overloaded / Selected model is at capacity. Please try a different model.. The terminal event was task_complete with last_agent_message: null (turn 019fa62c-0b6f-7bf0-ba34-e09aad4b8277).

    No sleep/retry loop occurred, and the user did not receive the error text—only a red failure icon. This confirms the same need beyond CLI: retry with bounded backoff while preserving tool/task state, then pause with explicit actions if retries are exhausted. A user setting should choose between continued retry, ask-before-model-switch, or automatic fallback to the closest allowed model.

  5. RepressedAlliance commented on Oct 14, 2026

    @RepressedAlliance

    Additional Windows desktop reproduction on 2026-10-14: capacity failures interrupt ongoing goal work even in a newly created independent chat.

    Environment: Windows desktop, ChatGPT Pro, GPT-6.1 Sol selected with High reasoning for the fresh chat. Exact desktop build was not verified in this report; I am not inferring it from a separately installed CLI.

    Observed timestamps (UTC), read from the desktop's thread/turn records:

    1. Existing chat: a turn started at 02:49:12 and failed at 02:49:15 with Selected model is at capacity. Please try a different model. The following turn started at 02:49:17, produced assistant output and completed tool calls, then failed with the same error at 02:51:37 (~140 seconds later).
    2. A fresh independent chat was then used for a separate affected task, without forking or importing the full old conversation. It received a handoff referring to existing local work files. Its first turn started at 03:02:31, established the goal, performed substantive tool/file work, and failed at 03:22:03 (~19 minutes 32 seconds) with the same capacity message. Its goal was later observed as blocked. A subsequent continuation is running, which is evidence of intermittent acceptance, not evidence of a lasting fix.
    3. The fresh task also reported that a review subagent encountered capacity failures. The root turn failure above is independently confirmed by the turn record; the subagent detail is reported by that task and is not a separate controlled reproduction here.

    Correlation identifiers for the fresh-chat failure:

    • Thread: 01a1385c-8a60-7bb2-b644-c3f9f3ec8172
    • Failed turn: 01a1385c-8d07-72c2-a789-6d82003a522e
    • Other task's failed turns: 01a13850-5a97-7261-b110-08e4dfa5ee54 and 01a13850-6d68-7bb2-8e5d-2a20195ebaa0

    Account usage was checked after these failures: ordinaryUsageAllowed=true, weekly usedPercent=45, rateLimitReachedType=null, spendControlReached=false. This is a post-failure snapshot, not a measurement taken at every failure instant.

    Impact: unattended goal work stops despite unfinished authorized work. Files already written remain available, but creating a fresh chat did not prevent recurrence. This report does not establish whether the cause is model-wide capacity, account/serving-pool routing, or client retry handling; it also does not equate a successful continuation with recovery of the service.

    Requested behavior: preserve task/tool progress across transient capacity failures and provide bounded backoff/resume in the existing chat, honoring server retry guidance. Clearly show when automatic retries are exhausted and whether the goal has stopped. Do not silently change the model, consume queued dependent prompts, or spawn additional monitoring chats. Explicit pause, completion, usage limits, and approval/input requirements must remain respected.

    Please correlate the failed turn with backend admission/serving telemetry and clarify whether the retry changes in CLI 0.161.0/0.162.0 cover this desktop goal lifecycle. Those release notes describe transport retry improvements; I have not confirmed the bundled desktop runtime includes them or that they recover a terminal goal failure.

    No full conversation transcript, task content, local paths, credentials, or screenshots containing private work are attached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    CLIIssues related to the Codex CLIenhancementNew feature or requestrate-limitsIssues related to rate limits, quotas, and token usage reporting

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions