From 00fd75a0a6f999b3b5da65e9d5c19620f3218c70 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 28 Apr 2026 21:19:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20memory=5Frecall/task=5Fquery=20=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=B8=AD=E7=9A=84=E5=AE=9E=E4=BD=93=E5=90=8D=E4=B9=9F?= =?UTF-8?q?=E5=86=99=E5=85=A5=20recorder=EF=BC=8C=E4=BE=9B=20WebUI=20?= =?UTF-8?q?=E6=8B=89=E9=95=9C=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/tool_executor.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/tool_executor.py b/core/tool_executor.py index a78e206..aaef4fe 100644 --- a/core/tool_executor.py +++ b/core/tool_executor.py @@ -26,6 +26,10 @@ def execute_tool(graph: Any, tool_name: str, arguments: dict) -> str: time_range=arguments.get("time_range"), session_filter=arguments.get("session_filter") ) + # 记录召回结果中的实体名,供 WebUI 高亮+拉镜头用 + for e in result.get("entities", []): + if e and isinstance(e, dict) and e.get("name"): + recorder.record("query", tool_name + "_found", e["name"]) return format_recall_result(result) elif tool_name == "memory_commit": @@ -118,6 +122,10 @@ def execute_tool(graph: Any, tool_name: str, arguments: dict) -> str: elif tool_name == "task_query": recorder.record("query", tool_name, "") result = execute_task_query(graph, arguments) + # 记录查询到的任务描述,供 WebUI 高亮 + for t in result.get("tasks", []): + if t and isinstance(t, dict) and t.get("description"): + recorder.record("query", tool_name + "_found", t["description"]) return json.dumps(result, ensure_ascii=False, default=str) return f"未知工具: {tool_name}"