fix(subagent): preserve follow-up provenance

This commit is contained in:
Dudu-0223
2026-07-24 13:18:35 +08:00
committed by imccyu
parent 1ab3cbf673
commit 189502e4ac
20 changed files with 202 additions and 87 deletions
@@ -67,7 +67,12 @@ export function apply(ctx: Context): void {
throw new Error('send_message requires a calling agent (exec.agent was undefined)')
}
const message: ContentBlock[] = [{ type: 'text', text: args.message }]
const result = ctx.subagentControl.sendMessage(parent, SessionId(args.subagent_id), message)
const result = ctx.subagentControl.sendMessage(
parent,
SessionId(args.subagent_id),
message,
{ kind: 'coordinator', senderSessionId: parent.id },
)
return Promise.resolve(result)
},
}))