From 4172e3ad2850249c606deb7b3c63c75702d5ad28 Mon Sep 17 00:00:00 2001 From: Aiden Cline <63023139+rekram1-node@users.noreply.github.com> Date: Fri, 1 Aug 2025 09:10:09 -0500 Subject: [PATCH] fix: bash tool errors for chmod (#1502) --- packages/opencode/src/tool/bash.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/tool/bash.ts b/packages/opencode/src/tool/bash.ts index 896ec79b..629201e3 100644 --- a/packages/opencode/src/tool/bash.ts +++ b/packages/opencode/src/tool/bash.ts @@ -74,7 +74,7 @@ export const BashTool = Tool.define("bash", { // not an exhaustive list, but covers most common cases if (["cd", "rm", "cp", "mv", "mkdir", "touch", "chmod", "chown"].includes(command[0])) { for (const arg of command.slice(1)) { - if (arg.startsWith("-")) continue + if (arg.startsWith("-") || (command[0] === "chmod" && arg.startsWith("+"))) continue const resolved = await $`realpath ${arg}`.text().then((x) => x.trim()) log.info("resolved path", { arg, resolved }) if (!Filesystem.contains(app.path.cwd, resolved)) {