fix(core): map legacy apply_patch permissions to edit (#57900)

This commit is contained in:
Aiden Cline
2026-10-21 15:57:56 -05:00
committed by GitHub
Unverified
parent 2e5a4deea8
commit 3260ec767c
2 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -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
+2
View File
@@ -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" },
])
})