Skip to content

fix(agent): dedupe model kwarg passed to AIAgent ctor on second turn - #33843

Closed
sweetcornna wants to merge 1 commit into
NousResearch:mainfrom
sweetcornna:fix/27540-aiagent-model-kwarg-dup
Closed

fix(agent): dedupe model kwarg passed to AIAgent ctor on second turn#33843
sweetcornna wants to merge 1 commit into
NousResearch:mainfrom
sweetcornna:fix/27540-aiagent-model-kwarg-dup

Conversation

@sweetcornna

@sweetcornna sweetcornna commented May 28, 2026

Copy link
Copy Markdown
Contributor

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.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels May 28, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing with #27678 (canonical fix for #27540) — both pop model from runtime_kwargs in api_server.py _create_agent. Previous duplicates #28059 and #31139 were already closed.

@alt-glitch alt-glitch added the duplicate This issue or pull request already exists label May 28, 2026
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
sweetcornna force-pushed the fix/27540-aiagent-model-kwarg-dup branch from 572d945 to e54c64e Compare June 3, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery duplicate This issue or pull request already exists P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants