From 0017beba20bbcfceb25c6cafd933ee49c390f76c Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Tue, 12 Aug 2025 17:05:44 +0000 Subject: [PATCH] Apply patch [skip ci] --- libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py index 6b359f201..dcd777d34 100644 --- a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py @@ -1226,8 +1226,10 @@ def create_react_agent( elif version == "v2": if post_model_hook is not None: return "post_model_hook" + # Create a temporary ToolExecutor to inject tool arguments + temp_executor = ToolExecutor(tool_classes[0]) if tool_classes else None tool_calls = [ - tool_node.inject_tool_args(call, state, store) # type: ignore[arg-type] + temp_executor.inject_tool_args(call, state, store) if temp_executor else call # type: ignore[arg-type] for call in last_message.tool_calls ] return [Send(call["name"], call) for call in tool_calls] @@ -1392,3 +1394,4 @@ __all__ = [ "AgentStateWithStructuredResponse", "AgentStateWithStructuredResponsePydantic", ] +