939
cancelSubagentSessions(parentChatURI: ProtocolURI): void {
940
for (const subagent of this._subagentChats.getAll(parentChatURI)) {
942
>
if (turnId) {
943
>
this._stateManager.dispatchServerAction(subagent.chatUri, {
944
>
type: ActionType.ChatTurnCancelled,
945
>
turnId,
946
>
duration: this._turnDuration(subagent.turnStopWatch),
947
>
});
948
>
this._turnTracker.turnCompleted(subagent.chatUri, turnId, 'cancelled');
949
>
}
950
>
this._toolCallTracker.clearSession(subagent.chatUri);
951
>
}
952
this._subagentChats.deleteAll(parentChatURI);
953
// Drop any buffered events targeted at subagents that never started.