fix: check worktree for external_directory permission in subdirs (#7811)

This commit is contained in:
Dillon Mulroy
2026-01-11 15:17:36 -05:00
committed by GitHub
parent 2e0c2c9db7
commit fa79736b87
5 changed files with 101 additions and 6 deletions

View File

@@ -85,7 +85,7 @@ export const BashTool = Tool.define("bash", async () => {
throw new Error("Failed to parse command")
}
const directories = new Set<string>()
if (!Filesystem.contains(Instance.directory, cwd)) directories.add(cwd)
if (!Instance.containsPath(cwd)) directories.add(cwd)
const patterns = new Set<string>()
const always = new Set<string>()
@@ -124,7 +124,7 @@ export const BashTool = Tool.define("bash", async () => {
process.platform === "win32" && resolved.match(/^\/[a-z]\//)
? resolved.replace(/^\/([a-z])\//, (_, drive) => `${drive.toUpperCase()}:\\`).replace(/\//g, "\\")
: resolved
if (!Filesystem.contains(Instance.directory, normalized)) directories.add(normalized)
if (!Instance.containsPath(normalized)) directories.add(normalized)
}
}
}