From ec64c6b98dd0ba4a95c2399045274b9f2b15f177 Mon Sep 17 00:00:00 2001 From: hexiaonan-800 Date: Wed, 23 Sep 2026 14:13:20 +0800 Subject: [PATCH] fix: AI chat node tool response text --- .../application/workflow/nodes/ai_chat_node/ai_chat_node.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/application/workflow/nodes/ai_chat_node/ai_chat_node.py b/apps/application/workflow/nodes/ai_chat_node/ai_chat_node.py index 4921e01059f..3c9e0f9a281 100644 --- a/apps/application/workflow/nodes/ai_chat_node/ai_chat_node.py +++ b/apps/application/workflow/nodes/ai_chat_node/ai_chat_node.py @@ -339,7 +339,7 @@ def execute(self): chat_id, workspace_id, workflow_type, - is_result, + is_result=is_result, ) if not mcp_handled: message_list_with_system = [SystemMessage(system)] + message_list @@ -490,7 +490,6 @@ def _handle_mcp( chat_id, workspace_id, workflow_type, - text_content_id, is_result=False, ): # 工具记录来源(source_type / source_id) @@ -515,7 +514,7 @@ def _handle_mcp( if tools or mcp_servers_config or skill_tool_ids: node_info = NodeInfo(self.get_node_id(), self.get_node_name(), Status.RUNNING) # 使用可变状态在回调间共享(answer 累积、当前文本 content id、工具 content id 映射) - state = {"answer": "", "text_id": text_content_id, "tool_id_map": {}} + state = {"answer": ""} tool_stream = ToolCallStreamManagement() node_info = NodeInfo(self.get_node_id(), self.get_node_name(), Status.RUNNING) @@ -592,6 +591,7 @@ def on_next(chunk): ) ) else: + state["answer"] = state["answer"] + chunk.content if is_result and chunk.content: self.write( TextContent(