summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAiden Cline <[email protected]>2026-03-27 23:53:36 -0500
committerGitHub <[email protected]>2026-03-27 23:53:36 -0500
commit15a8c22a263b072a23e2fc0b2e840b2e12c220aa (patch)
tree68d48a63fbf6caa49c1b4a1cf5adc200b846ff5f
parent48326e8d9ca5648b6ab1ee15f0374434be56c4d4 (diff)
downloadopencode-15a8c22a263b072a23e2fc0b2e840b2e12c220aa.tar.gz
opencode-15a8c22a263b072a23e2fc0b2e840b2e12c220aa.zip
tweak: adjust bash tool description to increase cache hit rates between projects (#19487)
-rw-r--r--packages/opencode/src/tool/bash.ts7
-rw-r--r--packages/opencode/src/tool/bash.txt2
2 files changed, 5 insertions, 4 deletions
diff --git a/packages/opencode/src/tool/bash.ts b/packages/opencode/src/tool/bash.ts
index 50ae4abac..228c2161b 100644
--- a/packages/opencode/src/tool/bash.ts
+++ b/packages/opencode/src/tool/bash.ts
@@ -57,9 +57,10 @@ export const BashTool = Tool.define("bash", async () => {
log.info("bash tool using shell", { shell })
return {
- description: DESCRIPTION.replaceAll("${directory}", Instance.directory)
- .replaceAll("${maxLines}", String(Truncate.MAX_LINES))
- .replaceAll("${maxBytes}", String(Truncate.MAX_BYTES)),
+ description: DESCRIPTION.replaceAll("${maxLines}", String(Truncate.MAX_LINES)).replaceAll(
+ "${maxBytes}",
+ String(Truncate.MAX_BYTES),
+ ),
parameters: z.object({
command: z.string().describe("The command to execute"),
timeout: z.number().describe("Optional timeout in milliseconds").optional(),
diff --git a/packages/opencode/src/tool/bash.txt b/packages/opencode/src/tool/bash.txt
index baafb0081..3ce39606a 100644
--- a/packages/opencode/src/tool/bash.txt
+++ b/packages/opencode/src/tool/bash.txt
@@ -1,6 +1,6 @@
Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.
-All commands run in ${directory} by default. Use the `workdir` parameter if you need to run a command in a different directory. AVOID using `cd <directory> && <command>` patterns - use `workdir` instead.
+All commands run in current working directory by default. Use the `workdir` parameter if you need to run a command in a different directory. AVOID using `cd <directory> && <command>` patterns - use `workdir` instead.
IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.