Feature hasn't been suggested before.
Describe the enhancement you want to request
Add configurable provider/model fallback so OpenCode can recover from transient provider failures by retrying once on an alternative model.
When the primary provider returns transient errors (for example 429, 500, 502, 503, or transient 403 from some gateways), sessions currently retry only on the same provider and can still fail after retries are exhausted. If users have multiple providers configured, OpenCode should be able to fail over automatically.
Requested behavior:
- Add a
fallback config map (primary -> fallback), e.g.:
openai/gpt-4o -> anthropic/claude-sonnet-4-20250514
- On fallback-worthy errors, retry once on the configured fallback model.
- Keep non-fallback errors as-is (auth failures, explicit context overflow, clear invalid-request errors).
- Provide clearer guidance for copilot-style transient 403s where reauthentication may be needed.
This is broader than #19394 (provider-specific retryability bug). #19394 focuses on Anthropic 5xx retry classification; this request adds general cross-provider fallback behavior.
Why this matters
- Improves reliability when one provider is degraded.
- Reduces user-facing session failures during transient outages/rate limits.
- Lets teams configure resilient multi-provider operation without manual intervention.
Related
Feature hasn't been suggested before.
Describe the enhancement you want to request
Add configurable provider/model fallback so OpenCode can recover from transient provider failures by retrying once on an alternative model.
When the primary provider returns transient errors (for example 429, 500, 502, 503, or transient 403 from some gateways), sessions currently retry only on the same provider and can still fail after retries are exhausted. If users have multiple providers configured, OpenCode should be able to fail over automatically.
Requested behavior:
fallbackconfig map (primary -> fallback), e.g.:openai/gpt-4o->anthropic/claude-sonnet-4-20250514This is broader than #19394 (provider-specific retryability bug). #19394 focuses on Anthropic 5xx retry classification; this request adds general cross-provider fallback behavior.
Why this matters
Related