fix(agent): dedupe model kwarg passed to AIAgent ctor on second turn - #33843
Closed
sweetcornna wants to merge 1 commit into
Closed
fix(agent): dedupe model kwarg passed to AIAgent ctor on second turn#33843sweetcornna wants to merge 1 commit into
sweetcornna wants to merge 1 commit into
Conversation
Collaborator
When the primary provider fails mid-session (e.g. the credential pool is exhausted between turn 1 and turn 2), the gateway's runtime resolver falls back to a chain entry whose runtime bundle includes its own ``model`` key. The API server adapter then splatted that dict next to an explicit ``model=`` kwarg, raising ``TypeError: AIAgent() got multiple values for keyword argument 'model'`` on the next agent construction — wedging the session until restart. Pop the runtime-supplied ``model`` and prefer it as the active model override, matching the canonical native-gateway path in ``GatewayRunner._resolve_session_agent_runtime``. Closes NousResearch#27540
sweetcornna
force-pushed
the
fix/27540-aiagent-model-kwarg-dup
branch
from
June 3, 2026 13:36
572d945 to
e54c64e
Compare
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.
Superseded by #27678, which is the canonical #27540 fix and carries broader coverage for both fallback-model and no-runtime-model paths plus production verification.
Closing this duplicate/competing PR per review feedback to keep the queue focused.