From fec80fc1d2f753b4de7db9ee668b804464c24a3b Mon Sep 17 00:00:00 2001 From: "open-swe[bot]" Date: Tue, 12 Aug 2025 17:03:36 +0000 Subject: [PATCH] Apply patch [skip ci] --- .../langgraph/prebuilt/chat_agent_executor.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py index dc3c000ec..b67955031 100644 --- a/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/prebuilt/langgraph/prebuilt/chat_agent_executor.py @@ -1341,11 +1341,15 @@ def create_react_agent( return entrypoint if should_return_direct: - workflow.add_conditional_edges( - "tools", route_tool_responses, path_map=[entrypoint, END] - ) + # Add conditional edges for each individual tool node + for tool in tool_classes: + workflow.add_conditional_edges( + tool.name, route_tool_responses, path_map=[entrypoint, END] + ) else: - workflow.add_edge("tools", entrypoint) + # Add edges from each individual tool node back to entrypoint + for tool in tool_classes: + workflow.add_edge(tool.name, entrypoint) # Finally, we compile it! # This compiles it into a LangChain Runnable, @@ -1385,3 +1389,4 @@ __all__ = [ +