Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/agent/acp/AcpSdkBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export interface AcpPermissionHandler {
toolCallId: string,
toolName: string,
input: unknown
): Promise<{ decision: 'approved' | 'approved_for_session' | 'denied' | 'abort' }>;
): Promise<{ decision: 'approved' | 'approved_for_session' | 'approved_execpolicy_amendment' | 'denied' | 'abort' }>;
}

/**
Expand Down Expand Up @@ -526,7 +526,10 @@ export class AcpSdkBackend implements AgentBackend {
// ACP uses optionId from the request options
let optionId = 'cancel'; // Default to cancel/deny

if (result.decision === 'approved' || result.decision === 'approved_for_session') {
const isApproved = result.decision === 'approved'
|| result.decision === 'approved_for_session'
|| result.decision === 'approved_execpolicy_amendment';
if (isApproved) {
// Find the appropriate optionId from the request options
// Look for 'proceed_once' or 'proceed_always' in options
const proceedOnceOption = options.find((opt: any) =>
Expand Down
2 changes: 1 addition & 1 deletion src/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export type AgentState = {
status: 'canceled' | 'denied' | 'approved',
reason?: string,
mode?: PermissionMode,
decision?: 'approved' | 'approved_for_session' | 'denied' | 'abort',
decision?: 'approved' | 'approved_for_session' | 'approved_execpolicy_amendment' | 'denied' | 'abort',
allowTools?: string[]
}
}
Expand Down
Loading