845
*/
846
requestPermission(args: {
848
>
readonly state: ToolCallPendingConfirmationState;
849
>
readonly permissionKind: ClaudePermissionKind;
850
>
readonly permissionPath?: string;
851
>
/** Phase 12 step 5 — when the confirmation belongs to a subagent context, route it to the subagent session. */
852
>
readonly parentToolCallId?: string;
853
>
}): Promise<boolean> {
854
>
if (!this._pipeline || this._pipeline.isAborted) {
855
return Promise.resolve(false);
856
}
858
>
this._onDidSessionProgress.fire({
859
>
kind: 'pending_confirmation',
860
>
chat: this._chatChannelUri,
861
>
state: args.state,
862
>
permissionKind: args.permissionKind,
863
>
...(args.permissionPath !== undefined ? { permissionPath: args.permissionPath } : {}),
864
>
...(args.parentToolCallId !== undefined ? { parentToolCallId: args.parentToolCallId } : {}),
865
>
});
866
>
});
867
>
}
868
869
respondToPermissionRequest(requestId: string, approved: boolean): boolean {