From df886e35c1b75c2c97f03628d8e85c703bd89ec7 Mon Sep 17 00:00:00 2001 From: Err Date: Thu, 30 Oct 2025 15:59:38 -0500 Subject: [PATCH] fix: resolve bash tool paths relative to cwd --- packages/opencode/src/tool/bash.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/opencode/src/tool/bash.ts b/packages/opencode/src/tool/bash.ts index a1489737221..8b651ce6812 100644 --- a/packages/opencode/src/tool/bash.ts +++ b/packages/opencode/src/tool/bash.ts @@ -69,6 +69,7 @@ export const BashTool = Tool.define("bash", { let workingDirectory = Instance.directory if (params.cwd) { const resolvedCwd = await $`realpath ${params.cwd}` + .cwd(Instance.directory) .quiet() .nothrow() .text() @@ -113,6 +114,7 @@ export const BashTool = Tool.define("bash", { for (const arg of command.slice(1)) { if (arg.startsWith("-") || (command[0] === "chmod" && arg.startsWith("+"))) continue const resolved = await $`realpath ${arg}` + .cwd(workingDirectory) .quiet() .nothrow() .text()