From 8af7edfb3265133313da06a70e9e78a6bf5dd257 Mon Sep 17 00:00:00 2001 From: oudecheng <13802883547@139.com> Date: Tue, 16 Jun 2026 17:46:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(todos):=20=E4=BF=AE=E5=A4=8D=E5=AD=90?= =?UTF-8?q?=E6=99=BA=E8=83=BD=E4=BD=93=20todo=20=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E6=B1=A1=E6=9F=93=E4=B8=BB=E6=99=BA=E8=83=BD=E4=BD=93=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 子智能体创建时 ToolContext.topic_id 继承了父智能体的 topic_id, 导致 scope_key_from_context 优先使用 topic_id 作为 scope key, 父子智能体共享同一个内存中的 TodoItem 列表。 修改为 topic_id: None,使 scope_key_from_context 回退到 子智能体唯一的 session_id (sub:{parent}:task:{uuid}), 实现完全隔离。消息持久化和前端加载链路均不受影响。 Co-Authored-By: Claude Opus 4.8 --- src/tools/task/runtime.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/task/runtime.rs b/src/tools/task/runtime.rs index 94fc4aa..c01746c 100644 --- a/src/tools/task/runtime.rs +++ b/src/tools/task/runtime.rs @@ -338,7 +338,7 @@ impl DefaultSubAgentRuntime { sender_id: None, chat_id: Some(session.parent_chat_id.clone()), session_id: Some(session.session_id.clone()), - topic_id: session.parent_topic_id.clone(), + topic_id: None, message_id: None, message_seq: None, subagent_description: Some(session.description.clone()),