Skip to content

HTTP 400 from model provider not surfaced to chat UI; session silently waits for idleTimedOut #89166

Closed

Description

@devin-ai-integration

When the gateway receives HTTP 400 from the model provider (e.g. quota exceeded), the error is not surfaced to the chat UI. The session silently waits 120s for idleTimedOut, then marks itself failed. User sees a hung session with no diagnostic. Expected: 400 errors from the provider should surface immediately as an error message in the chat UI.


Related issues (same quota-hit incident):

Activity

  1. clawsweeper commented on Jun 1, 2026

    @clawsweeper
    Contributor

    Thanks for the context here. I did a careful shell check against current main, and this is already implemented.

    Close: current main already routes provider failure text through error reply payloads and chat error events, so the chat UI no longer depends on the idle-timeout path for this class of failure.

    So I’m closing this as already implemented rather than keeping a duplicate issue open.

    Review details

    Best possible solution:

    Keep the current-main error-payload and chat-error projection for provider failures; handle the related fallback-chain behavior separately under the linked provider fallback report if it still reproduces.

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

    No: I did not run a live quota-hit provider repro, and current main source/tests show the old hang path should now surface as an error payload/event instead.

    Is this the best way to solve the issue?

    Yes: the current fix uses the existing provider-error classification, reply-payload, gateway chat event, and UI error rendering path rather than adding a new config or parallel UI mechanism.

    Security review:

    Security review: Issue triage only; no patch security review applies.

    AGENTS.md: found and applied where relevant.

    What I checked:

    • Repository policy applied: Root AGENTS.md was read fully and applied; it requires source, current behavior, related context, and history before a cleanup close. (AGENTS.md:1, ba88b7a1780f)
    • Vision fit: VISION.md prioritizes bug fixes, stability, provider support, and UI ergonomics, so provider-error surfacing is core maintenance work rather than optional plugin work. (VISION.md:13, ba88b7a1780f)
    • Provider error classification: Current main classifies quota and usage-limit text as provider rate-limit/billing signals, and regression tests cover HTTP 400 insufficient_quota classification instead of treating it as an unhelpful generic 400. (src/agents/embedded-agent-helpers/failover-matches.ts:66, ba88b7a1780f)
    • Agent reply surfacing: The agent runner now converts pre-reply billing/rate-limit/provider failures into final visible error payloads, and no-text mid-turn rate-limit/overload failures are injected as isError payloads instead of returning an empty response. (src/auto-reply/reply/agent-runner-execution.ts:2744, ba88b7a1780f)
    • Gateway chat error broadcast: chat.send detects returned isError reply payloads and broadcasts a chat error event carrying the provider failure text to the client run. (src/gateway/server-methods/chat.ts:3644, ba88b7a1780f)
    • Chat UI rendering: The UI builds an assistant-visible message from active-run error events, and tests cover rendering both raw error messages and server-provided assistant error messages. (ui/src/ui/controllers/chat.ts:898, ba88b7a1780f)

    Likely related people:

    • steipete: Available local blame, shortlog, and path history for the affected agent-runner, gateway chat, and UI chat-controller surfaces all point to Peter Steinberger as the recent current-main contributor for this behavior. (role: recent area contributor; confidence: medium; commits: e8c126eaf2c3, ba88b7a1780f; files: src/auto-reply/reply/agent-runner-execution.ts, src/gateway/server-methods/chat.ts, src/gateway/server-chat.ts)

    Codex review notes: model gpt-5.5, reasoning high; reviewed against ba88b7a1780f; fix evidence: commit e8c126eaf2c3, main fix timestamp 2026-06-01T15:12:50+01:00.

  2. added
    P1
    impact:message-loss
    impact:session-state
    impact:auth-provider
    on Jun 1, 2026
  3. locked as resolved and limited conversation to collaborators on Jun 4, 2026
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

    P1impact:auth-providerimpact:message-lossimpact:session-state

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions