Skip to content

Bug: HTTP 529 (Anthropic overloaded) does not trigger model fallback #28502

@Kosbling

Description

@Kosbling

Summary

When the Anthropic API returns HTTP 529 (overloaded), OpenClaw fails to trigger model fallback and becomes completely unresponsive — even when working fallback models are configured.

Root Cause

resolveFailoverReasonFromError in src/agents/failover-error.ts handles 402, 429, 401/403, 408, 503, 400 — but not 529.

When 529 is returned:

  1. coerceToFailoverError receives an error with no recognized status → returns null
  2. model-fallback.ts sees !isFailoverError(normalized)throw err immediately
  3. Fallback loop is skipped entirely
  4. OpenClaw becomes unresponsive until the primary model recovers

Fix

Add 529 to resolveFailoverReasonFromError:

// src/agents/failover-error.ts
if (status === 529) {
  return "timeout"; // Anthropic non-standard "overloaded" status
}

Notes

  • HTTP 529 is Anthropic's non-standard status code for API overload
  • This is particularly impactful for users routing through proxy providers where 529s are more frequent
  • The fix is one line and fully backward compatible

Reproducibility

Any setup where the primary Anthropic provider returns 529 (overloaded) while fallback providers are healthy and configured.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions