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()