672
}
673
674
>
const sessionUri = isAhpChatChannel(sessionKey) ? parseRequiredSessionUriFromChatUri(sessionKey) : sessionKey;
agentSideEffects.ts
675
>
676
>
// Stamp the subagent chat URI onto the tool call as soon as toolKind
677
>
// is known, so clients get it from the wire instead of deriving it.
678
>
if (
679
>
(action.type === ActionType.ChatToolCallStart || action.type === ActionType.ChatToolCallDelta || action.type === ActionType.ChatToolCallReady)
680
&& readToolCallMeta(action).toolKind === 'subagent'
681
&& readToolCallMeta(action).subagentChatUri === undefined
683
action = { ...action, _meta: { ...action._meta, subagentChatUri: buildSubagentChatUri(sessionUri, action.toolCallId) } };
684
}