fix(cli): propagate fallback_providers to AIAgent in oneshot mode#23683
Closed
shellybotmoyer wants to merge 1 commit into
Closed
fix(cli): propagate fallback_providers to AIAgent in oneshot mode#23683shellybotmoyer wants to merge 1 commit into
shellybotmoyer wants to merge 1 commit into
Conversation
Fixes NousResearch#18961. Two-line change: 1. Extract fallback config from already-loaded cfg: fallback_model = cfg.get("fallback_providers") or cfg.get("fallback_model") or None 2. Pass fallback_model=fallback_model to AIAgent(...) constructor (parity with gateway) The conflict against current main was trivial: origin/main added session_db=... and clarify_callback=... in the same code block; this change inserts the fallback_model extraction before session_db and adds the fallback_model= keyword between credential_pool and the clarify_callback comment block.
Collaborator
Contributor
|
Closing as already fixed on Triage notes (high confidence): If you still see this on the latest version, please reopen with reproduction steps. (Bulk-closed during a CLI triage sweep.) |
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.
Summary
Fixes #18961 —
--oneshotCLI mode now respects the configuredfallback_providerschain, bringing it to parity with gateway mode.This PR supersedes #18962 which fell 86 commits behind
mainand showsDIRTYmerge state.Problem
When the primary provider returns HTTP 429 (rate-limit) in
--oneshotmode, the agent hard-fails instead of falling back through thefallback_providerschain. Gateway mode already handles this correctly.Root Cause
hermes_cli/oneshot.pyloadscfg = load_config()but never extractsfallback_providers/fallback_model, and theAIAgent(...)call is missing thefallback_model=parameter.Fix (2 lines)
toolsets_listblock, extract fallback config:AIAgent(...):AIAgent.__init__already normalizes both list (fallback_providers) and legacy dict (fallback_model) formats, so this works with either config style.Conflict Resolution
origin/mainaddedsession_db = _create_session_db_for_oneshot()andclarify_callback=_oneshot_clarify_callbackin the same block as the old PR. This branch is rebased onto currentorigin/mainand inserts the fallback extraction between those two new lines.Testing
hermes_cli/oneshot.pyis valid Python (no syntax errors).AIAgent.__init__already acceptsfallback_model(line ~954 inrun_agent.py).