From 1c9fdfef6b3c5d49633493c912e2930256218b8a Mon Sep 17 00:00:00 2001 From: hetao Date: Fri, 18 Jul 2025 21:26:34 +0800 Subject: [PATCH] fix: fix the bug introduced by coordinator messages update --- src/graph/nodes.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/graph/nodes.py b/src/graph/nodes.py index 23b5046..4846acf 100644 --- a/src/graph/nodes.py +++ b/src/graph/nodes.py @@ -243,16 +243,12 @@ def coordinator_node( "Coordinator response contains no tool calls. Terminating workflow execution." ) logger.debug(f"Coordinator response: {response}") - old_messages = state.get("messages", []) - new_messages = old_messages + [ - { - "role": "assistant", - "content": response.content, - } - ] + messages = state.get("messages", []) + if response.content: + messages.append(HumanMessage(content=response.content, name="coordinator")) return Command( update={ - "messages": new_messages, + "messages": messages, "locale": locale, "research_topic": research_topic, "resources": configurable.resources,