Problem
OpenCode supports:
- Provider fallback only when the model ID is the same
- Static agent-level model overrides
There is no way to define fallback between different models, e.g.:
“If model A errors or rate-limits → automatically retry with model B”
This causes long-running agent workflows to fail on transient provider/model issues and forces users to rely on external routers or proxies (like litellm).
Request
Add first-class model fallback support to OpenCode.
Example (global)
Example (agent-level)
Behavior
- Switch models on: rate limits, provider/model unavailability, 5xx errors
- Do not retry on prompt or validation errors
- Optional retry limit
Why in Core
Status
- No existing plugin or PR implements true model fallback
Thanks,
Problem
OpenCode supports:
There is no way to define fallback between different models, e.g.:
This causes long-running agent workflows to fail on transient provider/model issues and forces users to rely on external routers or proxies (like litellm).
Request
Add first-class model fallback support to OpenCode.
Example (global)
{ "models": { "coder": { "fallback": [ "anthropic/claude-3.5-sonnet", "openai/gpt-4o", "deepseek/deepseek-r1" ] } } }Example (agent-level)
{ "agents": { "build": { "model": { "fallback": ["claude-sonnet", "gpt-4o-mini"] } } } }Behavior
Why in Core
onlyandorderfilters) #2153)Status
Thanks,