feat(auxiliary): add configurable fallback chains for auxiliary tasks (#26882)#26998
feat(auxiliary): add configurable fallback chains for auxiliary tasks (#26882)#26998zccyman wants to merge 1 commit into
Conversation
…NousResearch#26882) When a user explicitly configures an auxiliary task provider (e.g. auxiliary.vision.provider=glm), the fallback logic is gated behind is_auto=True and never triggers. This means a configured provider that fails (quota, rate-limit, connection) raises immediately with no recovery. Add auxiliary.<task>.fallback_chain config key — a list of {provider, model, base_url?, api_key?} entries tried in order when the primary provider fails. Works for ALL auxiliary tasks (vision, tts, compression, web_extract, etc.), not just auto-detected ones. Closes NousResearch#26882
|
Thanks @alt-glitch for the cross-reference. Good catch on the crowded space. A clarification on scope differentiation:
Both are convergent solutions to the same class of problem (auxiliary resilience), but at different granularities. Leaving open for upstream to decide on the preferred scope. |
|
Superseded by #27625 (merged). Your |
Summary
Add configurable
fallback_chainfor auxiliary tasks so that when a configured provider fails (quota, rate-limit, connection), the system automatically tries alternative providers instead of raising immediately.Closes #26882
Problem
Currently, auxiliary task fallback only works when
resolved_provideris"auto"(no explicit provider configured). When a user explicitly configures an auxiliary task (e.g.,auxiliary.vision.provider: glm), theis_autogate at the fallback entry point prevents any fallback:This means a user who configures
auxiliary.vision.provider: glmgets zero recovery when glm fails — the error propagates directly.Solution
auxiliary.<task>.fallback_chain— a list of{provider, model, base_url?, api_key?}entries_try_configured_fallback_chain()— reads the chain from config, tries each entry viaresolve_provider_client()is_autorequirement from the outer gate; auto-chain runs first (existing behaviour), then configured chain runs as fallbackConfig example
Behaviour
autousers)fallback_chainentries in orderFiles Changed
agent/auxiliary_client.py_try_configured_fallback_chain(),_resolve_single_provider(), modifiedcall_llm()andasync_call_llm()fallback gatesTest Results
Design Decisions
config.yaml, not in Pythonautofallback behaviour is unchanged;fallback_chainis purely additiveresolve_provider_client(): No duplicate provider resolution logic