diff --git a/packages/core/src/v1/config/migrate.ts b/packages/core/src/v1/config/migrate.ts index 6c9eb2938d2..569a0061d8e 100644 --- a/packages/core/src/v1/config/migrate.ts +++ b/packages/core/src/v1/config/migrate.ts @@ -26,7 +26,7 @@ function permissions(info?: ConfigPermissionV1.Info) { // Map v1 permission/tool keys onto their renamed v2 tool actions so migrated rules keep matching. export function normalizeAction(action: string) { - if (action === "write" || action === "patch") return "edit" + if (action === "write" || action === "patch" || action === "apply_patch") return "edit" if (action === "task") return "subagent" if (action === "bash") return "shell" return action diff --git a/packages/core/test/config/config.test.ts b/packages/core/test/config/config.test.ts index c7ccbb1b2cd..61b6d5a7a60 100644 --- a/packages/core/test/config/config.test.ts +++ b/packages/core/test/config/config.test.ts @@ -1237,6 +1237,7 @@ describe("Config", () => { task: "ask", bash: { "git status": "allow", "*": "deny" }, write: "deny", + apply_patch: "deny", read: "allow", }, }).permissions, @@ -1245,6 +1246,7 @@ describe("Config", () => { { action: "shell", resource: "git status", effect: "allow" }, { action: "shell", resource: "*", effect: "deny" }, { action: "edit", resource: "*", effect: "deny" }, + { action: "edit", resource: "*", effect: "deny" }, { action: "read", resource: "*", effect: "allow" }, ]) })