Persist subagent intermediate messages for the agent tracker view.
This commit is contained in:
@@ -488,6 +488,14 @@ func (m *Manager) spawnSubagent(parentCtx context.Context, parent core.Run, name
|
||||
m.st.UpdateRun(&child)
|
||||
m.emit(child.ConversationID, child.ID, core.EvAgentResult, payload)
|
||||
|
||||
// 子代理中间过程落库(AgentTracker 弹窗的权威数据源;消息树带 run_id 归属)。
|
||||
m.mu.Lock()
|
||||
subParts := append([]core.Part{}, h.assistant...)
|
||||
m.mu.Unlock()
|
||||
if len(subParts) > 0 {
|
||||
_ = m.st.AppendMessage(&core.Message{ConversationID: child.ConversationID, RunID: child.ID, Role: core.RoleAssistant, Parts: subParts})
|
||||
}
|
||||
|
||||
m.mu.Lock()
|
||||
delete(m.active, child.ID)
|
||||
m.mu.Unlock()
|
||||
|
||||
Reference in New Issue
Block a user