fix(acp): preserve permission state when tool input is missing (#1782)

This commit is contained in:
SSU-WEI HUANG
2026-09-09 09:22:27 +08:00
committed by GitHub
parent 9048bfa4f1
commit d332cd5957
7 changed files with 156 additions and 34 deletions
+1 -8
View File
@@ -1,7 +1,7 @@
import type { ApiSessionClient } from '@/api/apiSession';
import type { AgentBackend, PermissionRequest, PermissionResponse } from '@/agent/types';
import type { OpencodePermissionMode } from '@hapi/protocol/types';
import { deriveToolName } from '@/agent/utils';
import { deriveToolInput, deriveToolName } from '@/agent/utils';
import { logger } from '@/ui/logger';
import {
BasePermissionHandler,
@@ -17,13 +17,6 @@ interface PermissionResponseMessage {
reason?: string;
}
function deriveToolInput(request: PermissionRequest): unknown {
if (request.rawInput !== undefined) {
return request.rawInput;
}
return request.rawOutput;
}
function pickOptionId(
request: PermissionRequest,
preferredKinds: string[],