LangGraph Swarm: Missing ToolMessage for Tool Calls Before Agent Handoff #3715
jainamnahar14surat
started this conversation in
Discussions
Replies: 3 comments 7 replies
-
Any updates on this? |
Beta Was this translation helpful? Give feedback.
1 reply
-
@vbarda could you please respond to this? |
Beta Was this translation helpful? Give feedback.
4 replies
-
this works for openai and anthropic models but what about gemini models? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using langgraph_swarm with multiple agents and tool calls. The issue is that when an agent makes a tool call (e.g., transfer_to_reporting_agent), LangGraph expects a corresponding ToolMessage, but sometimes the agent switches before the ToolMessage is recorded, causing this error:
ValueError: Found AIMessages with tool_calls that do not have a corresponding ToolMessage.
What I've Observed:
What I’ve Tried:
Question:
How can I ensure that LangGraph properly records ToolMessages before switching agents? Has anyone else faced this issue?
Beta Was this translation helpful? Give feedback.
All reactions