when a shell tool call invokes apply_patch, resolve relative paths against workdir, if specified

This commit is contained in:
Michael Bolin
2025-04-22 12:56:07 -07:00
parent f99c9080fd
commit 9c51116b01
4 changed files with 63 additions and 13 deletions

View File

@@ -11,7 +11,13 @@ describe("canAutoApprove()", () => {
const writeablePaths: Array<string> = [];
const check = (command: ReadonlyArray<string>): SafetyAssessment =>
canAutoApprove(command, "suggest", writeablePaths, env);
canAutoApprove(
command,
/* workdir */ undefined,
"suggest",
writeablePaths,
env,
);
test("simple safe commands", () => {
expect(check(["ls"])).toEqual({