feat: support fallback_models list for multi-provider cascade - #3815
Closed
zero-agent wants to merge 1 commit into
Closed
feat: support fallback_models list for multi-provider cascade#3815zero-agent wants to merge 1 commit into
zero-agent wants to merge 1 commit into
Conversation
Add support for a `fallback_models` list in config.yaml so multiple
backup providers are tried in order when earlier ones fail:
fallback_models:
- provider: openai-codex
model: gpt-5.4
- provider: custom
model: local-model
base_url: http://localhost:8080/v1
When the primary fails after retries, the agent tries each fallback in
sequence. If the first fallback also fails (e.g. rate-limited), it
cascades to the next until all are exhausted.
Backward compatible: existing single `fallback_model` config still works.
Author
|
Closing — superseded by #3813 which was merged with the same feature (ordered fallback provider chain). Our implementation overlapped. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
fallback_models(list) config support so multiple backup providers are tried in order when earlier ones fail.Config:
Behavior: primary fails → try fallback 1 → if that also fails → try fallback 2 → … → give up.
Changes:
gateway/run.py:_load_fallback_model()readsfallback_modelslist, falls back to legacyfallback_modeldictrun_agent.py:_try_activate_fallback()cycles through chain instead of one-shottests/test_fallback_chain.py: 27 new testsBackward compatible — existing
fallback_modelconfig still works unchanged.