fix(todos): 修复子智能体 todo 列表污染主智能体的问题
子智能体创建时 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 <noreply@anthropic.com>
This commit is contained in:
parent
a9f549f4c0
commit
8af7edfb32
@ -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()),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user