Skip to content

[Feature]: [Feature Request] Smart, reliable fallback + auto-retry for overloaded errors (Anthropic 529, “The AI service is temporarily overloaded”, 503/502/504, api_error, etc.) #29014

@mingchan820

Description

@mingchan820

Summary

當主要模型回傳 overloaded 錯誤時(特別是 Anthropic 的 HTTP 529、Gemini/OpenAI 的「The AI service is temporarily overloaded. Please try again in a moment.」、503/502/504、api_error 等),目前 OpenClaw 不會正確觸發

Problem to solve

Related Issues

Proposed solution

Related Issues

Alternatives considered

No response

Impact

  1. 把 primary model 設成 anthropic/claude-3-5-sonnet-20241022(或任何容易過載的模型)
  2. 在vice is tempora設定好 fallbacks:
    agents:
      defaults:
        model:
          primary: anthropic/claude-3-5-sonnet-20241022
          fallbacks:
            - gemini/gemini-2.0-flash
            - moonshot/kimi-k2.5
            - openai/gpt-4o-mini

正常對話一段時間後,遇到 overloaded
結果:session 永久 hang 住,fallback 完全不執行,連 retry 都沒有
Expected Behavior(我建議的理想行為)
自動偵測所有常見 overloaded 錯誤(HTTP status + error message 雙重判斷)
立即觸發 fallback(依序嘗試下一個模型)
自動 retry 機制(同一個模型先 exponential backoff retry 3 次 → 再切 fallback)
UI 逃生門:在聊天視窗顯示臨時提示「AI 暫時過載,正在切換模型…」並支援 /retry 或 /model next 手動強制切換
可設定 fallback 順序、健康檢查間隔、單一模型最大 retry 次數

Evidence/examples

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions