Skip to content

executeWithApiKeyRotation should retry on 5xx/timeout, not just 429 #60422

Description

@KurtVogel

Description

executeWithApiKeyRotation only retries when isApiKeyRateLimitError returns true, which checks for rate-limit patterns (429, quota exceeded, too many requests). A 500, 502, or 503 from a transcription provider (Groq, OpenAI, Deepgram) is not retried at all.

With a single API key configured, there are zero retry attempts for transient server errors. This means a single Groq hiccup silently kills the entire transcription.

Current Behavior

  • Rate limit (429) errors: retried with next API key (good)
  • Server errors (500/502/503): thrown immediately, no retry
  • Timeouts (AbortError): thrown immediately, no retry
  • Network errors: thrown immediately, no retry

Suggested Fix

Add at least one retry with exponential backoff for transient errors (5xx, timeout, network). This could be a separate retry wrapper or an extension of the existing shouldRetry callback to include transient patterns.

Environment

  • OpenClaw 2026.4.2
  • Provider: Groq

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions