1157
}
1158
case ActionType.ChatToolCallConfirmed: {
1160
throw new Error(`ChatToolCallConfirmed must be handled on an AHP chat channel: ${channel}`);
1161
}
1163
>
const agentId = this._toolCallAgents.get(toolCallKey);
1164
>
if (agentId) {
1165
>
this._toolCallAgents.delete(toolCallKey);
1166
>
const agent = this._options.agents.get().find(a => a.id === agentId);
1167
>
agent?.respondToPermissionRequest(action.toolCallId, action.approved);
1168
>
} else {
1169
this._logService.warn(`[AgentSideEffects] No agent for tool call confirmation: ${action.toolCallId}`);
1170
}
1172
>
// When the user chose "Allow in this Session", add the tool
1173
>
// to the session's permissions so future calls are auto-approved.
1174
>
if (action.approved) {
1175
this._permissionManager.handleToolCallConfirmed(channel, action.toolCallId, action.selectedOptionId);
1176
}
1178
>
}
1179
case ActionType.ChatInputCompleted: {
1180
if (!chatChannel) {