fix(agent): add missing name field to tool messages for Gemini compatibility#16583
Open
vominh1919 wants to merge 1 commit into
Open
fix(agent): add missing name field to tool messages for Gemini compatibility#16583vominh1919 wants to merge 1 commit into
name field to tool messages for Gemini compatibility#16583vominh1919 wants to merge 1 commit into
Conversation
…ibility All tool result messages (role: "tool") were missing the required name field. While OpenAI tolerates this, Gemini and other strict OpenAI-compatible providers return HTTP 400 when name is absent. Fixes NousResearch#16478
Collaborator
|
Likely duplicate of #16482 — both add missing name field to role:tool messages in run_agent.py for Gemini compatibility. |
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.
Fixes #16478
Problem
All tool result messages (
role: "tool") were missing the requirednamefield. While OpenAI's API tolerates this, Gemini and other strict OpenAI-compatible providers return HTTP 400 whennameis absent.Root Cause
The tool message dicts in
run_agent.pyonly includedrole,content, andtool_call_id, but omitted thenamefield that identifies which function the tool response belongs to.Fix
Added
"name": <function_name>to all 9 tool message construction sites inrun_agent.py:Testing
role: "tool"messages now include thenamefieldast.parse()on the full file