@langchain/aws Bug: ChatBedrockConverse fails when ToolMessage is returned after AI Message that has both content and tool_use #198

Closed
opened 2026-02-15 17:17:10 -05:00 by yindo · 1 comment
Owner

Originally created by @khanzzirfan on GitHub (Mar 11, 2025).

#6349
#141

Details:
Hello Team, I looked at the nodejs code for langgraph-supervisor and this is where the issue is
https://github.com/langchain-ai/langgraphjs/blob/main/libs/langgraph-supervisor/src/handoff.ts#L62C1-L85C2

When using Bedrock chat converse and Mistral large model, This piece of code is returning "role": "Assistant" twice and bedrock don't like it. Hence the error.

Originally created by @khanzzirfan on GitHub (Mar 11, 2025). [#6349](https://github.com/langchain-ai/langchainjs/issues/6349) [#141 ](https://github.com/langchain-ai/langchain-aws/issues/141) Details: Hello Team, I looked at the nodejs code for langgraph-supervisor and this is where the issue is https://github.com/langchain-ai/langgraphjs/blob/main/libs/langgraph-supervisor/src/handoff.ts#L62C1-L85C2 When using Bedrock chat converse and Mistral large model, This piece of code is returning "role": "Assistant" twice and bedrock don't like it. Hence the error.
yindo closed this issue 2026-02-15 17:17:10 -05:00
Author
Owner

@benjamincburns commented on GitHub (Mar 13, 2025):

Hi @khanzzirfan - thanks for reporting this.

Unfortunately, as you noted with your first link this is actually a bug in the LangChainJS ChatBedrockConverse code that impacts langgraph-supervisor. Unless I'm mistaken, I don't see anything about the code that you linked that is introducing additional complications beyond those that are present from the LangChain bug that you linked.

Since there's nothing for us to do here in the LangGraph codebase, I'm going to close this issue. Once the issue is resolved on the LangChain side, LangGraph Supervisor should work as expected.

@benjamincburns commented on GitHub (Mar 13, 2025): Hi @khanzzirfan - thanks for reporting this. Unfortunately, as you noted with your first link this is actually a bug in the LangChainJS `ChatBedrockConverse` code that impacts `langgraph-supervisor`. Unless I'm mistaken, I don't see anything about the code that you linked that is introducing additional complications beyond those that are present from the LangChain bug that you linked. Since there's nothing for us to do here in the LangGraph codebase, I'm going to close this issue. Once the issue is resolved on the LangChain side, LangGraph Supervisor should work as expected.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#198