Skip to content

[Bug]: Retrying a Claude turn while still limited reports "gave up after repeated API errors" again #10544

Description

@vitalyiegorov

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. On a Claude subscription, exhaust the 5-hour window and send a message to a Claude thread. The turn fails with "Claude usage limit reached. Send the message again once the limit resets." (fix(claude): name the expired login or usage limit instead of a generic API error #10321, merged).
  2. Send another message to the same thread while still limited.

Expected behavior

Every limited turn names the limit, as the first one did.

Actual behavior

Only the first limited turn gets the new sentence. Each retry ends with the old "Claude gave up after repeated API errors." above the CLI's own line "You've hit your session limit · resets 9:20pm".

The CLI sends rate_limit_event with status: "rejected" only when the limit state changes, so the first turn records it in turnState.rejectedRateLimitTypes and the result names the limit. A retry while still limited carries no new rate_limit_event; it only carries an assistant message with error: "rate_limit" (the SDK's SDKAssistantMessageError union) and then result with terminal_reason: "api_error". handleAssistantMessage in apps/server/src/provider/Layers/ClaudeAdapter.ts latches error: "authentication_failed" from that message but not error: "rate_limit", so handleResultMessage has no evidence and falls back to the generic sentence.

Three turns in a row on the same thread, 19:25 correct, 19:26 and 19:26 generic:

Timeline: first limited turn says 'Claude usage limit reached', the two retries say 'Claude gave up after repeated API errors'

Impact

Minor bug or occasional failure

Version or commit

main @ 1d1bf50

Environment

macOS 15, desktop app; Claude Code CLI 2.1.263, Claude subscription (OAuth); server on Linux

Logs or stack traces

# retry turn, SDK messages seen by the adapter
assistant { error: "rate_limit", message: { content: [{ type: "text", text: "You've hit your session limit · resets 9:20pm (Europe/Vienna)" }] } }
result    { subtype: "success", is_error: true, terminal_reason: "api_error" }
# no rate_limit_event in this turn

Screenshots, recordings, or supporting files

No response

Workaround

None; the first turn's message is still visible above.

Activity

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

    acceptedfeature request acceptedbugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions