feat(acp): permission requests a dialect claims are presented as questions, never auto-answered (#28449)

A dialect's request() now presents session/request_permission when it claims it,
and full access no longer auto-allows a claimed request. No dialect claims
permission requests yet, so nothing changes today.
This commit is contained in:
Brennan Benson
2026-10-14 00:17:23 -07:00
committed by GitHub
parent 83ddc89596
commit 1ccb2897f2
3 changed files with 5 additions and 4 deletions
+1
View File
@@ -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
+2 -1
View File
@@ -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) {
+2 -3
View File
@@ -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.