Skip to content

feat: model failover — automatic fallback when primary provider fails #8947

@bugmaker2

Description

@bugmaker2

Background

OpenClaw implements automatic model failover:

  • Define multiple auth profiles per provider (API keys, OAuth tokens)
  • Define a fallback chain: primary model → backup model → backup provider
  • On API errors (rate limit, auth failure, model outage), automatically rotate to next in chain
  • No user-visible interruption; transparent failover

Hermes Agent's hermes_cli/models.py has model selection but no automatic failover infrastructure.

Proposal

Add model failover infrastructure:

  1. Auth profiles: Allow multiple credentials per provider (key rotation, multiple accounts)
  2. Failover chain config: In config.yaml, define models.fallback: ["anthropic/claude-opus-4", "openai/gpt-4.5"]
  3. Automatic detection: On 401/403/429/500 errors from provider, rotate to next in chain
  4. Retry with backoff: Attempt primary again after cooldown
  5. User notification: Inform user when failover occurred ("Using backup model")

References

  • OpenClaw: docs/concepts/model-failover, model-fallback.ts

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low — cosmetic, nice to havearea/configConfig system, migrations, profilescomp/agentCore agent loop, run_agent.py, prompt buildersweeper:implemented-on-mainSweeper: behavior already present on current maintype/featureNew 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