createReactAgent does not support parallel tool callings in streaming mode #286

Closed
opened 2026-02-15 18:15:30 -05:00 by yindo · 3 comments
Owner

Originally created by @postbird on GitHub (Jun 17, 2025).

I am using the createReactAgent to build a simple agent with one tool, and I am using the AzureChatOpenAI.

The issue is that when the model returns two parallel tool_calls, there are something wrong.

How should I process the parallel tool_calls? Or should I disable parallel tool calling?

I do not see any params can let me disable parallel tool calling with createReactAgent https://langchain-ai.github.io/langgraphjs/reference/types/langgraph_prebuilt.CreateReactAgentParams.html

Image

["values",{"messages":[{"lc":1,"type":"constructor","id":["langchain_core","messages","HumanMessage"],"kwargs":{"id":"-19698eb3-f28b-41dc-afba-f0b39beac826","content":"the weather in London and Paris","additional_kwargs":{},"response_metadata":{}}},{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"I'll get the weather information for both London and Paris for you.","additional_kwargs":{"tool_calls":[{"index":0,"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","type":"function","function":{"name":"weather_toolweather_tool","arguments":"{\"city\": \"London\"}{\"city\": \"Paris\"}"}}]},"response_metadata":{"usage":{"completion_tokens":3,"prompt_tokens":438,"total_tokens":441}},"tool_call_chunks":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","index":0,"type":"tool_call_chunk"}],"id":"msg_vrtx_01FABieqWPAKSZNAky2SmW17","usage_metadata":{"input_tokens":438,"output_tokens":107,"total_tokens":545},"tool_calls":[],"invalid_tool_calls":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","error":"Malformed args.","type":"invalid_tool_call"}]}}]}]

Versions of lang stack packages I am using:

"@langchain/core": "^0.3.57",
"@langchain/langgraph": "^0.3.0",
"@langchain/openai": "^0.5.11",

The agent defination(one tool named weatherTool):

  const agent = createReactAgent({
    llm: model,
    tools: [weatherTool],
    prompt:
      'You are a good assistant, you can use tool and reply to user, but you can only use English to reply',
    checkpointSaver: LANGGRAPH_MEMORY_SAVER,
  });

streamMode I am using:

   streamMode: ['updates', 'custom', 'messages', 'values'],

user input:

the weather in London and Paris

streaming messages chunk list:

["values",{"messages":[{"lc":1,"type":"constructor","id":["langchain_core","messages","HumanMessage"],"kwargs":{"id":"-19698eb3-f28b-41dc-afba-f0b39beac826","content":"the weather in London and Paris","additional_kwargs":{},"response_metadata":{}}}]}]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[],"additional_kwargs":{},"id":"msg_vrtx_01FABieqWPAKSZNAky2SmW17","response_metadata":{"usage":{"completion_tokens":3,"prompt_tokens":438,"total_tokens":441}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"I'll get","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":" the weather information for both","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":" London","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":" and Paris for","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":" you","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":".","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"name":"weather_tool","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1L","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1L","type":"function","function":{"name":"weather_tool"}}]},"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1L","response_metadata":{"usage":{}},"tool_calls":[{"name":"weather_tool","args":{},"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1L","type":"tool_call"}],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[{"name":"","args":{},"id":"","type":"tool_call"}],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":"{\"c","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":"{\"c"}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":"{\"c","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":"it","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":"it"}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":"it","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":"y\": ","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":"y\": "}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":"y\": ","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":"\"London\"}","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":"\"London\"}"}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":"\"London\"}","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"name":"weather_tool","id":"toolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"toolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","type":"function","function":{"name":"weather_tool"}}]},"id":"toolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","response_metadata":{"usage":{}},"tool_calls":[{"name":"weather_tool","args":{},"id":"toolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","type":"tool_call"}],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[{"name":"","args":{},"id":"","type":"tool_call"}],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":"{\"city\":","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":"{\"city\":"}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":"{\"city\":","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":" \"Paris\"}","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":" \"Paris\"}"}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":" \"Paris\"}","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{"completion_tokens":107,"prompt_tokens":438,"total_tokens":545}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]]
["updates",{"agent":{"messages":[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"I'll get the weather information for both London and Paris for you.","additional_kwargs":{"tool_calls":[{"index":0,"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","type":"function","function":{"name":"weather_toolweather_tool","arguments":"{\"city\": \"London\"}{\"city\": \"Paris\"}"}}]},"response_metadata":{"usage":{"completion_tokens":3,"prompt_tokens":438,"total_tokens":441}},"tool_call_chunks":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","index":0,"type":"tool_call_chunk"}],"id":"msg_vrtx_01FABieqWPAKSZNAky2SmW17","usage_metadata":{"input_tokens":438,"output_tokens":107,"total_tokens":545},"tool_calls":[],"invalid_tool_calls":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","error":"Malformed args.","type":"invalid_tool_call"}]}}]}}]
["values",{"messages":[{"lc":1,"type":"constructor","id":["langchain_core","messages","HumanMessage"],"kwargs":{"id":"-19698eb3-f28b-41dc-afba-f0b39beac826","content":"the weather in London and Paris","additional_kwargs":{},"response_metadata":{}}},{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"I'll get the weather information for both London and Paris for you.","additional_kwargs":{"tool_calls":[{"index":0,"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","type":"function","function":{"name":"weather_toolweather_tool","arguments":"{\"city\": \"London\"}{\"city\": \"Paris\"}"}}]},"response_metadata":{"usage":{"completion_tokens":3,"prompt_tokens":438,"total_tokens":441}},"tool_call_chunks":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","index":0,"type":"tool_call_chunk"}],"id":"msg_vrtx_01FABieqWPAKSZNAky2SmW17","usage_metadata":{"input_tokens":438,"output_tokens":107,"total_tokens":545},"tool_calls":[],"invalid_tool_calls":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","error":"Malformed args.","type":"invalid_tool_call"}]}}]}]
Originally created by @postbird on GitHub (Jun 17, 2025). I am using the `createReactAgent` to build a simple agent with one tool, and I am using the `AzureChatOpenAI`. The issue is that when the model returns two parallel tool_calls, there are something wrong. How should I process the parallel tool_calls? Or should I disable parallel tool calling? > I do not see any params can let me disable parallel tool calling with `createReactAgent` https://langchain-ai.github.io/langgraphjs/reference/types/langgraph_prebuilt.CreateReactAgentParams.html ![Image](https://github.com/user-attachments/assets/66c9a503-83eb-4693-90b1-e502e58bb69c) ```ts ["values",{"messages":[{"lc":1,"type":"constructor","id":["langchain_core","messages","HumanMessage"],"kwargs":{"id":"-19698eb3-f28b-41dc-afba-f0b39beac826","content":"the weather in London and Paris","additional_kwargs":{},"response_metadata":{}}},{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"I'll get the weather information for both London and Paris for you.","additional_kwargs":{"tool_calls":[{"index":0,"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","type":"function","function":{"name":"weather_toolweather_tool","arguments":"{\"city\": \"London\"}{\"city\": \"Paris\"}"}}]},"response_metadata":{"usage":{"completion_tokens":3,"prompt_tokens":438,"total_tokens":441}},"tool_call_chunks":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","index":0,"type":"tool_call_chunk"}],"id":"msg_vrtx_01FABieqWPAKSZNAky2SmW17","usage_metadata":{"input_tokens":438,"output_tokens":107,"total_tokens":545},"tool_calls":[],"invalid_tool_calls":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","error":"Malformed args.","type":"invalid_tool_call"}]}}]}] ``` **Versions of lang stack packages I am using:** ``` "@langchain/core": "^0.3.57", "@langchain/langgraph": "^0.3.0", "@langchain/openai": "^0.5.11", ``` **The agent defination(one tool named weatherTool):** ```ts const agent = createReactAgent({ llm: model, tools: [weatherTool], prompt: 'You are a good assistant, you can use tool and reply to user, but you can only use English to reply', checkpointSaver: LANGGRAPH_MEMORY_SAVER, }); ``` **streamMode I am using:** ``` streamMode: ['updates', 'custom', 'messages', 'values'], ``` user input: ```bash the weather in London and Paris ``` streaming messages chunk list: ```ts ["values",{"messages":[{"lc":1,"type":"constructor","id":["langchain_core","messages","HumanMessage"],"kwargs":{"id":"-19698eb3-f28b-41dc-afba-f0b39beac826","content":"the weather in London and Paris","additional_kwargs":{},"response_metadata":{}}}]}] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[],"additional_kwargs":{},"id":"msg_vrtx_01FABieqWPAKSZNAky2SmW17","response_metadata":{"usage":{"completion_tokens":3,"prompt_tokens":438,"total_tokens":441}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"I'll get","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":" the weather information for both","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":" London","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":" and Paris for","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":" you","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":".","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"name":"weather_tool","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1L","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1L","type":"function","function":{"name":"weather_tool"}}]},"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1L","response_metadata":{"usage":{}},"tool_calls":[{"name":"weather_tool","args":{},"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1L","type":"tool_call"}],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[{"name":"","args":{},"id":"","type":"tool_call"}],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":"{\"c","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":"{\"c"}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":"{\"c","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":"it","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":"it"}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":"it","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":"y\": ","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":"y\": "}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":"y\": ","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":"\"London\"}","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":"\"London\"}"}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":"\"London\"}","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"name":"weather_tool","id":"toolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"toolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","type":"function","function":{"name":"weather_tool"}}]},"id":"toolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","response_metadata":{"usage":{}},"tool_calls":[{"name":"weather_tool","args":{},"id":"toolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","type":"tool_call"}],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[{"name":"","args":{},"id":"","type":"tool_call"}],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":"{\"city\":","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":"{\"city\":"}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":"{\"city\":","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[{"args":" \"Paris\"}","id":"","index":0,"type":"tool_call_chunk"}],"additional_kwargs":{"tool_calls":[{"index":0,"id":"","type":"function","function":{"arguments":" \"Paris\"}"}}]},"id":"","response_metadata":{"usage":{}},"tool_calls":[],"invalid_tool_calls":[{"args":" \"Paris\"}","id":"","error":"Malformed args.","type":"invalid_tool_call"}]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["messages",[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"","tool_call_chunks":[],"additional_kwargs":{},"id":"","response_metadata":{"usage":{"completion_tokens":107,"prompt_tokens":438,"total_tokens":545}},"tool_calls":[],"invalid_tool_calls":[]}},{"tags":["seq:step:2"],"thread_id":"1750155244464","run_id":"-4ae83be9-4d73-44da-93d7-430aed5fc3e5","langgraph_step":1,"langgraph_node":"agent","langgraph_triggers":["branch:to:agent"],"langgraph_path":["__pregel_pull","agent"],"langgraph_checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","__pregel_task_id":"fd419395-3f32-5876-912d-7e8a847587e5","checkpoint_ns":"agent:fd419395-3f32-5876-912d-7e8a847587e5","ls_provider":"azure","ls_model_name":"gcp-claude4-sonnet","ls_model_type":"chat","ls_temperature":0,"ls_max_tokens":8192}]] ["updates",{"agent":{"messages":[{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"I'll get the weather information for both London and Paris for you.","additional_kwargs":{"tool_calls":[{"index":0,"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","type":"function","function":{"name":"weather_toolweather_tool","arguments":"{\"city\": \"London\"}{\"city\": \"Paris\"}"}}]},"response_metadata":{"usage":{"completion_tokens":3,"prompt_tokens":438,"total_tokens":441}},"tool_call_chunks":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","index":0,"type":"tool_call_chunk"}],"id":"msg_vrtx_01FABieqWPAKSZNAky2SmW17","usage_metadata":{"input_tokens":438,"output_tokens":107,"total_tokens":545},"tool_calls":[],"invalid_tool_calls":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","error":"Malformed args.","type":"invalid_tool_call"}]}}]}}] ["values",{"messages":[{"lc":1,"type":"constructor","id":["langchain_core","messages","HumanMessage"],"kwargs":{"id":"-19698eb3-f28b-41dc-afba-f0b39beac826","content":"the weather in London and Paris","additional_kwargs":{},"response_metadata":{}}},{"lc":1,"type":"constructor","id":["langchain_core","messages","AIMessageChunk"],"kwargs":{"content":"I'll get the weather information for both London and Paris for you.","additional_kwargs":{"tool_calls":[{"index":0,"id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","type":"function","function":{"name":"weather_toolweather_tool","arguments":"{\"city\": \"London\"}{\"city\": \"Paris\"}"}}]},"response_metadata":{"usage":{"completion_tokens":3,"prompt_tokens":438,"total_tokens":441}},"tool_call_chunks":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","index":0,"type":"tool_call_chunk"}],"id":"msg_vrtx_01FABieqWPAKSZNAky2SmW17","usage_metadata":{"input_tokens":438,"output_tokens":107,"total_tokens":545},"tool_calls":[],"invalid_tool_calls":[{"name":"weather_toolweather_tool","args":"{\"city\": \"London\"}{\"city\": \"Paris\"}","id":"toolu_vrtx_01NtFxPRameyYEvsYYUrNH1Ltoolu_vrtx_011uWT8jXj6xqU2qJhKQ45ZU","error":"Malformed args.","type":"invalid_tool_call"}]}}]}] ```
yindo added the enhancementgood first issue labels 2026-02-15 18:15:30 -05:00
yindo closed this issue 2026-02-15 18:15:30 -05:00
Author
Owner

@postbird commented on GitHub (Jun 17, 2025):

How to disable parallel tool calling with createReactAgent ?
Tried #977 but got error.

@postbird commented on GitHub (Jun 17, 2025): How to disable parallel tool calling with `createReactAgent` ? Tried #977 but got error.
Author
Owner

@govardhan27 commented on GitHub (Aug 18, 2025):

Hi, I'd like to work on this issue. Can you assign it to me?

@govardhan27 commented on GitHub (Aug 18, 2025): Hi, I'd like to work on this issue. Can you assign it to me?
Author
Owner

@dqbd commented on GitHub (Sep 11, 2025):

Hello! Cannot reproduce the example while using @langchain/openai and @langchain/langgraph^0.3, so closing the stale issue, but:

  1. With @langchain/langgraph 0.4.3 we've improved handling of partial application of tool calls, which may be applicable here.
  2. You can use the following code to disable parallel tool calling. Do note that it's up to the underlying provider to support these arguments, so for instance Vertex AI might not support disabling parallel tool calls.
const agent = createReactAgent({
  llm: model.bindTools([weatherTool], { parallel_tool_calls: false }),
  tools: [weatherTool],
  prompt:
    "You are a good assistant, you can use tool and reply to user, but you can only use English to reply",
  checkpointSaver: new MemorySaver(),
});
@dqbd commented on GitHub (Sep 11, 2025): Hello! Cannot reproduce the example while using `@langchain/openai` and `@langchain/langgraph^0.3`, so closing the stale issue, but: 1. With `@langchain/langgraph` 0.4.3 we've improved handling of partial application of tool calls, which may be applicable here. 2. You can use the following code to disable parallel tool calling. Do note that it's up to the underlying provider to support these arguments, so for instance Vertex AI might not support disabling parallel tool calls. ```typescript const agent = createReactAgent({ llm: model.bindTools([weatherTool], { parallel_tool_calls: false }), tools: [weatherTool], prompt: "You are a good assistant, you can use tool and reply to user, but you can only use English to reply", checkpointSaver: new MemorySaver(), }); ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraphjs#286