Skip to content

ChatGPT SSE drops HTTP status and ignores Retry-After pacing #137145

Closed

Description

@steipete

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

ChatGPT SSE HTTP 503 responses with an unfamiliar message lose their status before retry classification, causing immediate empty-error retries that ignore the response's seven-second Retry-After header.

Steps to reproduce

  1. Serve a loopback HTTP endpoint returning status 503, Retry-After: 7, and {"error":{"message":"Maintenance in progress."}}.
  2. Call the real ChatGPT Responses provider with SSE transport, the loopback base URL, and synthetic JWT auth containing a synthetic account ID.
  3. Pass each terminal assistant into handleEmbeddedAssistantFailure with createEmbeddedRunFailoverRetryController, preserving the empty-error counter as the caller does. Keep the attempt replay-safe, with no output or tool effects.
  4. Record incoming HTTP request times through the retry budget. Repeat with a configured fallback.

Expected behavior

The existing model failover contract gives the embedded controller sole transient retry ownership and honors provider pacing. The transport must retain HTTP 503 and Retry-After together so the controller can classify and wait.

Actual behavior

Four requests arrived at 0/179/184/186 ms without a fallback and 0/4/6/8 ms with one. Neither case consulted the transient controller. The terminal error was Maintenance in progress.; Retry-After: 7 seconds, with no HTTP status or provider code. Classification returned null; the fallback case eventually threw an unknown failure.

OpenClaw version

Source a828190; the implicated producer is also unchanged at main snapshot b55b725.

Operating system

macOS 27.0, Node 26.8.1

Install method

Trusted source worktree with matching pinned dependencies; direct repository test/proof wrappers.

Model

Synthetic loopback model for deterministic outage proof. Separate authenticated smoke uses openai/gpt-5.6-luna.

Provider / routing chain

Embedded OpenClaw ChatGPT SSE provider -> loopback HTTP endpoint -> real assistant-failure owner and failover retry controller.

Additional provider/model setup details

Isolated proof HOME/state; no operator Gateway or state was modified. This does not allege a defect in native Codex app-server retry behavior.

Logs

HTTP 503; Retry-After:7
errorMessage=Maintenance in progress.; Retry-After: 7 seconds
classifiedReason=null
transientControllerConsults=0
requests(no fallback)=0,179,184,186 ms
requests(with fallback)=0,4,6,8 ms

Screenshots, recordings, and evidence

Four focused regression cases fail before the repair because status 429/500/503 is missing. The corrected transport passes 241 owner/sibling tests and the full changed gate. The same real loopback fault then paces every retry by seven seconds; a 503-then-200 recovery completes the synthetic reply after that wait. Separate authenticated ChatGPT 200 success and 400 invalid-parameter error prove the actual provider success/non-OK paths; no live outage or quota exhaustion was forced.

Impact and severity

Affected surface: embedded ChatGPT SSE, including its auto-transport fallback leg. This deterministically exhausts the available recovery budget as a burst for a code-free 503 with unfamiliar wording, allowing an avoidable failure or premature model fallback. Production frequency is unknown. No data loss was observed.

Additional information

Related: #134281. Raw parent-relative source comparison shows that 4a1cc22 removed status-based inner retry ownership without retaining status at the central handoff. Stable v2026.8.2 used status-based inner retries; that stable timing comparison is source-only, not an executed timing run.

Activity

  1. self-assigned this
    on Sep 3, 2026
  2. added
    maintainer
    on Sep 3, 2026
  3. added
    P1
    clawsweeper:linked-pr-open
    clawsweeper:no-new-fix-pr
    clawsweeper:source-repro
    impact:auth-provider
    issue-rating: 🦞 diamond lobster
    on Sep 3, 2026
  4. clawsweeper commented on Sep 3, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed September 3, 2026, 3:39 AM ET / 07:39 UTC.

    Summary
    Keep open. Current main still drops the SSE HTTP status before the canonical failure classifier, while the formally linked open PR is a focused candidate fix; the maintainer label also requires explicit maintainer handling.

    Reproducibility: yes. current source establishes the loopback 503 path—status is read but discarded, while the classifier needs retained status before the existing controller can apply the Retry-After hint.

    Regression provenance
    Possible regression — probable (reviewed change; failure trace). No predecessor PR is attributed.

    Next step
    Do not create a parallel repair: #137146 formally owns this small source-proven bug, and this issue carries the protected maintainer label.

    Review details

    Best possible solution:

    At the SSE producer, construct the existing typed provider error with status and code, then prove unfamiliar 429/500/503 responses with Retry-After are classified and paced by the one existing retry controller without reintroducing a transport-local retry loop.

    Do we have a high-confidence way to reproduce the issue?

    Yes: current source establishes the loopback 503 path—status is read but discarded, while the classifier needs retained status before the existing controller can apply the Retry-After hint.

    Is this the best way to solve the issue?

    Yes: preserving status at the SSE producer is the owner-boundary repair because it lets the existing classifier and single retry controller operate without another retry implementation.

    AGENTS.md: found and applied where relevant.

    Codex review notes: model internal, reasoning high; reviewed against 583a17763ed9.

    Label changes

    Label changes:

    • add P1: A temporary ChatGPT provider outage can exhaust recovery as an immediate burst and cause avoidable failure or fallback.
    • add impact:auth-provider: The broken path is ChatGPT provider error classification and retry pacing.
    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:linked-pr-open: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.

    Label justifications:

    • P1: A temporary ChatGPT provider outage can exhaust recovery as an immediate burst and cause avoidable failure or fallback.
    • impact:auth-provider: The broken path is ChatGPT provider error classification and retry pacing.
    Evidence reviewed

    What I checked:

    • Current producer drops status: The SSE non-OK branch reads the HTTP status and Retry-After header, but creates CodexApiError with only message and provider code. The error type exposes no status field, so later generic projection cannot retain 503 for unfamiliar provider text. (packages/ai/src/providers/openai-chatgpt-responses.ts:526, 583a17763ed9)
    • Classifier requires retained status: The failover signal derives status from the assistant error message and passes it to the shared classifier; assistant-failure handling consults the retry controller only after that classification. An unfamiliar message with only a Retry-After suffix therefore lacks the status evidence needed for the 503 path. (src/agents/embedded-agent-helpers/assistant-message-failures.ts:18, 583a17763ed9)
    • Existing retry-owner contract: Current docs specify that the embedded failover controller owns transient retries and provider pacing, and that visible failures preserve HTTP status independently of classification. The current SSE regression test checks only the Retry-After suffix, not status retention. Public docs: docs/concepts/model-failover.md. (docs/concepts/model-failover.md:269, 583a17763ed9)
    • Regression context and release boundary: The merged retry-owner change is on current main but not in stable v2026.8.2. Its commit message establishes the single-controller invariant; raw parent file comparison was unavailable because this partial clone could not fetch missing blobs while network DNS was unavailable, so no predecessor PR is asserted as a verified cause. (src/agents/embedded-agent-runner/run/failover-retry-controller.ts:150, 4a1cc226964a)
    • Open implementation candidate: The provided GitHub context identifies fix(openai): preserve ChatGPT HTTP status for retry pacing #137146 as open, formally linked to this issue, and specifically intended to retain HTTP status and Retry-After at the canonical handoff. (fc9e715ea3c4)

    Likely related people:

    • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1clawsweeper:linked-pr-openclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:auth-providerissue-rating: 🦞 diamond lobstermaintainer

Type

No type

Fields

Priority

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions