diff --git a/src/acp/client.test.ts b/src/acp/client.test.ts index 57d17c5be26..2595e89bfee 100644 --- a/src/acp/client.test.ts +++ b/src/acp/client.test.ts @@ -366,6 +366,26 @@ describe("resolvePermissionRequest", () => { expect(prompt).not.toHaveBeenCalled(); }); + it("auto-approves safe tools when rawInput is the only identity hint", async () => { + const prompt = vi.fn(async () => true); + const res = await resolvePermissionRequest( + makePermissionRequest({ + toolCall: { + toolCallId: "tool-raw-only", + title: "Searching files", + status: "pending", + rawInput: { + name: "search", + query: "foo", + }, + }, + }), + { prompt, log: () => {} }, + ); + expect(res).toEqual({ outcome: { outcome: "selected", optionId: "allow" } }); + expect(prompt).not.toHaveBeenCalled(); + }); + it("prompts when raw input spoofs a safe tool name for a dangerous title", async () => { const prompt = vi.fn(async () => false); const res = await resolvePermissionRequest(