Skip to content

feat(tui): add backup models array#30852

Open
jjdubski wants to merge 1 commit into
anomalyco:devfrom
jjdubski:feat/backup-models
Open

feat(tui): add backup models array#30852
jjdubski wants to merge 1 commit into
anomalyco:devfrom
jjdubski:feat/backup-models

Conversation

@jjdubski
Copy link
Copy Markdown

@jjdubski jjdubski commented Jun 5, 2026

Issue for this PR

Closes #25150
Closes #7602
Closes #20100
Closes #16868

Type of change

  • New feature

What does this PR do?

  • Adds a way to add backup models (array format)
  • It goes through the array until it can complete successfully. If not, it will try the last model on the retry loop (current behavior using selected model)
  • Shows 'Used backup model: provider/model' at the end of prompt completion so user knows it switched to the backup and which one it used
  • No backup model defined, standard retry logic is used

This improves the user experience, especially for those who like to use the free models. It sucks when the session breaks when the rate limit is hit, and it continues to retry or shows "Retrying in 4h 31m...". This way it will continue on error, switching to the backup when the provider is down, or usage is hit.

Format for backup model is an array with "model/provider", same as model. Example:

backupModel: ["opencode/big-pickle", "opencode-go/deepseek-v4-flash"]

How did you verify your code works?

  • Ran bun test inside the packages/opencode directory
  • Ran bun typecheck
  • User testing (sending prompts and trying out the feature) works on compaction and standard prompts sent by user
image

Screenshots / recordings

image

How it looks in my commit-storyteller.md agent file in .config/opencode/agents directory:

image

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Any feedback would be greatly appreciated!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Jun 5, 2026

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate PRs Found

I found two related PRs that address similar functionality:

  1. feat(session): add configurable fallback model chain (feat(session): add configurable fallback model chain #27939)

  2. feat(opencode): add LLM provider fallback chain (feat(opencode): add LLM provider fallback chain #26292)

These PRs may be duplicates or overlapping implementations of the backup/fallback model feature. You should review PRs #27939 and #26292 to understand if:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant