From a2151478ee4ea39d4f20764879523a9dcd1ffada Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Thu, 26 Mar 2026 17:03:58 +0200 Subject: [PATCH] fix(cli): check movePath in apply_patch config guard --- packages/opencode/src/kilocode/permission/config-paths.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/opencode/src/kilocode/permission/config-paths.ts b/packages/opencode/src/kilocode/permission/config-paths.ts index 662851ad9d..79794d11f8 100644 --- a/packages/opencode/src/kilocode/permission/config-paths.ts +++ b/packages/opencode/src/kilocode/permission/config-paths.ts @@ -82,11 +82,14 @@ export namespace ConfigProtection { } } - // Check metadata.files[] (apply_patch file objects with absolute filePath) + // Check metadata.files[] (apply_patch file objects with absolute filePath/movePath) const files = request.metadata?.files if (Array.isArray(files)) { for (const file of files) { - if (typeof file?.filePath === "string" && isAbsolute(file.filePath)) return true + for (const key of ["filePath", "movePath"] as const) { + const val = file?.[key] + if (typeof val === "string" && (path.isAbsolute(val) ? isAbsolute(val) : isRelative(val))) return true + } } }