fix: allow user to configure doom loop & external dir perms (#4095)

This commit is contained in:
Aiden Cline
2025-11-09 18:21:38 -08:00
committed by GitHub
parent 7be8e16c33
commit 4e549b1c05
8 changed files with 95 additions and 62 deletions

View File

@@ -55,18 +55,20 @@ export const PatchTool = Tool.define("patch", {
if (!Filesystem.contains(Instance.directory, filePath)) {
const parentDir = path.dirname(filePath)
await Permission.ask({
type: "external-directory",
pattern: parentDir,
sessionID: ctx.sessionID,
messageID: ctx.messageID,
callID: ctx.callID,
title: `Patch file outside working directory: ${filePath}`,
metadata: {
filepath: filePath,
parentDir,
},
})
if (agent.permission.external_directory === "ask") {
await Permission.ask({
type: "external_directory",
pattern: parentDir,
sessionID: ctx.sessionID,
messageID: ctx.messageID,
callID: ctx.callID,
title: `Patch file outside working directory: ${filePath}`,
metadata: {
filepath: filePath,
parentDir,
},
})
}
}
switch (hunk.type) {