Skip to content

[Bug]: Pooled native Codex requests do not retry or fail over on upstream server_is_overloaded / upstream_server_error before output #6969

Closed

Description

@lidge-jun

Description

Pooled native Codex requests to gpt-6.1-sol fail with a single attempt when the upstream declines before any output with server_is_overloaded (503, "Our servers are currently overloaded. Please try again later.") or upstream_server_error (502). The proxy neither retries nor moves the request to another healthy pool account. Codex then reports "Selected model is at capacity. Please try a different model." and ends the turn without retrying.

This is the upstream counterpart of #6642, which covered a locally generated server_is_overloaded during a restart drain. Related: #6740 (Windows 502 surge).

Steps to reproduce

  1. Run OpenCodex 2.83.0 on macOS with a native Codex pool of 4 ChatGPT accounts.
  2. Send many concurrent gpt-6.1-sol Responses requests with effort high (about 800 per hour from parallel agent sessions).
  3. Watch the upstream decline some of them at the protocol prelude.

Expected

A decline before any output is safe to replay. The proxy should retry with a short backoff, or move to another eligible pool account, before it returns a terminal 503 or 502.

Actual

Each failed request has exactly one attempt (sendCount: 1, recoveryKinds: [], failureStage: "protocol-prelude", failureCause: "upstream-declined", spend.moveReasons: ["healthy"], affinity: "new_bind"). Between 15:00 and 16:00 KST on 2026-10-12, 43 of 826 gpt-6.1-sol requests failed this way: 14 with 503 server_is_overloaded and 29 with 502 upstream_server_error. The failures were spread across all four pool accounts. One conversation hit 502 four times on the same account (Codex's own 5xx retries), then a terminal 503.

Environment

  • OpenCodex 2.83.0 (Bun 1.4.2), macOS, /Applications/OpenCodex.app/Contents/MacOS/ocx start --port 10100
  • Codex clients routed through openai_base_url = http://127.0.0.1:10100/v1
  • Native route, 4-account ChatGPT pool

Impact

In parallel agent orchestration every transient upstream overload becomes a hard turn failure, and clients that retry at once make the overload worse.

Activity

  1. added
    bug
    on Oct 12, 2026
  2. Ingwannu commented on Oct 12, 2026

    @Ingwannu
    Owner

    Current dev a0191a1b6f already has a transient-5xx alternate-account path (passthrough-dispatch.ts:1648, shouldRetryCodexPoolAccountTransient in core-codex-account.ts:372). It deliberately excludes a Response marked non-replayable. In the WebSocket exchange, a create sent upstream but not committed to the client can produce such a marked prelude failure because origin execution may already have started.

    Therefore sendCount:1 plus no visible output is not by itself proof that replay is safe or that general 5xx failover is absent. Please distinguish an authoritative terminal refusal from socket death/silence after send, and include the redacted stage fields/current explicit retry grant for one occurrence. #6974 adds terminal frame/status diagnostics for exactly that distinction; it does not itself authorize retry or fix this report.

    The narrow regression for any proposed recovery must show an authoritative refusal reaching the existing shared send budget, cancellation during backoff, fixed-account behavior and no alternate-account replay for ambiguous post-send failure or any output/tool effect. No live accounts/load generation or automatic replay policy change was performed during this triage. Keeping this open pending that evidence and the owner decision on the native recovery contract.

  3. lidge-jun commented on Oct 12, 2026

    @lidge-jun
    OwnerAuthor

    Fixed on dev by #6997 (commit a061e70086), landed through #7009 (merge 8f10f238e3). Ships in 2.84.0.

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

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions