diff --git a/src/main/acp/acp-dialects/acp-dialect.ts b/src/main/acp/acp-dialects/acp-dialect.ts index e0bd89d70e0..364a9496c12 100644 --- a/src/main/acp/acp-dialects/acp-dialect.ts +++ b/src/main/acp/acp-dialects/acp-dialect.ts @@ -95,6 +95,7 @@ export type AcpDialect = { contextWindow?(models: unknown): number | undefined /** A model's own effort menu and default, as the agent advertises them per model. */ modelEfforts?(model: ModelInfo): { efforts: AgentSessionOptionChoice[]; defaultEffort?: string } + /** A request shown to the person; a permission request it claims is never auto-answered. */ request?(method: string, params: unknown): AcpRequestPresentation | undefined /** Requests answered at once instead of shown to the person. */ settleRequest?(method: string, params: unknown): AcpRequestSettlement | undefined diff --git a/src/main/acp/acp-structured-acquire.ts b/src/main/acp/acp-structured-acquire.ts index 926a83623c9..98323a272a1 100644 --- a/src/main/acp/acp-structured-acquire.ts +++ b/src/main/acp/acp-structured-acquire.ts @@ -125,7 +125,8 @@ export async function acquireAcpStructuredSession(input: { // is cutting it short: nobody is there to ask. return { outcome: { outcome: 'cancelled' } } } - if (launch.fullAccess) { + // A request the dialect claims is a question for the person, which full access never answers. + if (launch.fullAccess && !spec.dialect.request?.('session/request_permission', request)) { // Full access: Orca answers yes for the person, as the agent's own bypass flag would. const allow = request.options.find((option) => option.kind === 'allow_once') if (allow) { diff --git a/src/main/acp/acp-timeline-requests.ts b/src/main/acp/acp-timeline-requests.ts index 4afdf09cb38..9b82596218d 100644 --- a/src/main/acp/acp-timeline-requests.ts +++ b/src/main/acp/acp-timeline-requests.ts @@ -105,9 +105,8 @@ export function translateAcpRequest( } } const presentation = - method === 'session/request_permission' - ? acpPermissionPresentation(params) - : options.dialect.request?.(method, params) + options.dialect.request?.(method, params) ?? + (method === 'session/request_permission' ? acpPermissionPresentation(params) : undefined) if (!presentation) { // A file system or terminal call Orca never advertised is the agent's own misstep (OpenCode 1.x // repeats each approved edit as a file write it already made): refused, with no row.