Support per rule model fallbacks for outages and credit depletion #890

Open
opened 2026-02-16 17:28:41 -05:00 by yindo · 9 comments
Owner

Originally created by @esafak on GitHub (Jul 23, 2025).

Originally assigned to: @thdxr on GitHub.

Support the specification of multiple models per mode, in order of preference like so:

"mode": {
    "build": { "models": ["google/gemini-2.5-pro", "openai/o4-mini"] }
}
Originally created by @esafak on GitHub (Jul 23, 2025). Originally assigned to: @thdxr on GitHub. Support the specification of multiple models per mode, in order of preference like so: ```json "mode": { "build": { "models": ["google/gemini-2.5-pro", "openai/o4-mini"] } } ```
Author
Owner

@Sewer56 commented on GitHub (Sep 30, 2025):

I'm also quite interested in this actually, but I've nothing else to add outside of that unfortunately.
The idea of being able to burn up one subscription to the end and fall back to another seems quite appealing- it'd help me make the most of my limits.

@Sewer56 commented on GitHub (Sep 30, 2025): I'm also quite interested in this actually, but I've nothing else to add outside of that unfortunately. The idea of being able to burn up one subscription to the end and fall back to another seems quite appealing- it'd help me make the most of my limits.
Author
Owner

@OscSer commented on GitHub (Jan 2, 2026):

This would be very useful, I use OpenCode with subscriptions to GitHub Copilot, Claude Code, and GLM. When I hit the usage limits on any of them mid-task, the workflow gets interrupted. Having fallback models would make the tool more reliable and efficient.

@OscSer commented on GitHub (Jan 2, 2026): This would be very useful, I use OpenCode with subscriptions to GitHub Copilot, Claude Code, and GLM. When I hit the usage limits on any of them mid-task, the workflow gets interrupted. Having fallback models would make the tool more reliable and efficient.
Author
Owner

@smashah commented on GitHub (Jan 10, 2026):

this would definitely be a gamechanger especially with recent (un)developments r.e claude and their gatekeeping

@smashah commented on GitHub (Jan 10, 2026): this would definitely be a gamechanger especially with recent (un)developments r.e claude and their gatekeeping
Author
Owner

@pdobrev commented on GitHub (Jan 11, 2026):

Another use-case for this feature would be using the same model from different providers. For example, zAI's GLM-4.7 is offered by Cerebras at insane speeds, but the token-per-minute limits are exhausted pretty quickly. If we could have that by default, but then fallback onto Zen's GLM-4.7 and then after the minute go back to Cerebras, this would make the experience extremely smooth.

@pdobrev commented on GitHub (Jan 11, 2026): Another use-case for this feature would be using the same model from different providers. For example, zAI's GLM-4.7 is offered by Cerebras at insane speeds, but the token-per-minute limits are exhausted pretty quickly. If we could have that by default, but then fallback onto Zen's GLM-4.7 and then after the minute go back to Cerebras, this would make the experience extremely smooth.
Author
Owner

@manascb1344 commented on GitHub (Jan 13, 2026):

Very useful feature

@manascb1344 commented on GitHub (Jan 13, 2026): Very useful feature
Author
Owner

@manascb1344 commented on GitHub (Jan 13, 2026):

Hey! I’m looking into implementing this. I’ve poked around the repo and the plan seems pretty straightforward:

  1. Update PermissionObject in config.ts so models can take an array.
  2. In processor.ts, wrap the LLM calls in a loop that catches 429s or credit depletion errors.
  3. If a model hits a wall, it just cycles to the next one in the list and retries the request.

I'm ready to start on a PR for this if the approach looks good to you guys.

@manascb1344 commented on GitHub (Jan 13, 2026): Hey! I’m looking into implementing this. I’ve poked around the repo and the plan seems pretty straightforward: 1. Update PermissionObject in config.ts so models can take an array. 2. In processor.ts, wrap the LLM calls in a loop that catches 429s or credit depletion errors. 3. If a model hits a wall, it just cycles to the next one in the list and retries the request. I'm ready to start on a PR for this if the approach looks good to you guys.
Author
Owner

@Sewer56 commented on GitHub (Jan 14, 2026):

Looks sensible to me. @manascb1344
It's more less what I expect.

@Sewer56 commented on GitHub (Jan 14, 2026): Looks sensible to me. @manascb1344 It's more less what I expect.
Author
Owner

@elijahdev0 commented on GitHub (Jan 15, 2026):

+1 really need this!

@elijahdev0 commented on GitHub (Jan 15, 2026): +1 really need this!
Author
Owner

@manascb1344 commented on GitHub (Jan 16, 2026):

I've made the PR for this!

@manascb1344 commented on GitHub (Jan 16, 2026): I've made the PR for this!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#890