fix(review): propagate configured curator fallback chains - #79750
Cloudymap1e wants to merge 1 commit into
Conversation
|
Hi @Cloudymap1e — I independently opened #93664 for the same bug before Three things from building the same fix that may be useful here:
|
hermes_cli/oneshot.py::_run_agent called resolve_runtime_provider() bare. When the primary's credential pool is exhausted (quota 429), expired, or cooled down, that raises AuthError before AIAgent exists, so the mid-session fallback_model wiring never gets a chance and `hermes -z` dies for the whole quota window even with a healthy fallback_providers chain configured — the gateway (_try_resolve_fallback_provider) and the interactive CLI (_resolve_fallback_runtime) already walk the chain at resolution time (#81209). Add one shared hermes_cli/runtime_provider.py::resolve_runtime_with_fallback(): AuthError-only trigger (ValueError misconfiguration such as a typo'd --provider still fails loudly instead of being rerouted), get_fallback_chain() semantics (managed overlay, key_env, effective_runtime_provider identity), primary-error precedence when every entry fails. Oneshot uses it and sends the chosen entry's model; the primary's stored api_mode is dropped on a switch. The helper is the extraction point for the auxiliary/curator ports (#82132, #79750) and the gateway loop. Salvaged from PR #81562 (AuthError-only, injectable resolver, oneshot wiring) with the chain-walk and error-precedence properties adjudicated from PR #81517. Fixes #81209
hermes_cli/oneshot.py::_run_agent called resolve_runtime_provider() bare. When the primary's credential pool is exhausted (quota 429), expired, or cooled down, that raises AuthError before AIAgent exists, so the mid-session fallback_model wiring never gets a chance and `hermes -z` dies for the whole quota window even with a healthy fallback_providers chain configured — the gateway (_try_resolve_fallback_provider) and the interactive CLI (_resolve_fallback_runtime) already walk the chain at resolution time (NousResearch#81209). Add one shared hermes_cli/runtime_provider.py::resolve_runtime_with_fallback(): AuthError-only trigger (ValueError misconfiguration such as a typo'd --provider still fails loudly instead of being rerouted), get_fallback_chain() semantics (managed overlay, key_env, effective_runtime_provider identity), primary-error precedence when every entry fails. Oneshot uses it and sends the chosen entry's model; the primary's stored api_mode is dropped on a switch. The helper is the extraction point for the auxiliary/curator ports (NousResearch#82132, NousResearch#79750) and the gateway loop. Salvaged from PR NousResearch#81562 (AuthError-only, injectable resolver, oneshot wiring) with the chain-walk and error-precedence properties adjudicated from PR NousResearch#81517. Fixes NousResearch#81209
Summary
Fixes #78371
Testing
git diff --check— passedChecklist