217
}
218
if (!envelope.origin && envelope.action.type === ActionType.ChatToolCallComplete) {
220
>
// Chat-action envelopes are emitted on the chat channel URI;
221
>
// agents are keyed by session URI, so resolve back to the
222
>
// owning session before notifying the agent. Pass the chat URI
223
>
// alongside so agents that track peer chats can route correctly.
224
>
if (!isAhpChatChannel(envelope.channel)) {
225
return; // Not a chat channel; ignore (already logged elsewhere).
226
}
227
>
const sessionChannel = parseRequiredSessionUriFromChatUri(envelope.channel);
agentSideEffects.ts
228
>
this._notifyClientToolCallComplete(sessionChannel, envelope.channel, action.toolCallId, action.result, 'server-envelope');
229
>
}
230
if (envelope.action.type === ActionType.ChatDraftChanged) {
231
this._persistChatDraft(envelope.channel, envelope.action.draft);