summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-08-12 16:14:40 -0400
committerDax Raad <[email protected]>2025-08-12 16:14:40 -0400
commitd16ae1fc4e6732dfb0d497f389f10c5ab04c253a (patch)
tree72c83d9abd72a73918906fe142fdbc0ed4d38805
parent14e00a06b6885dd10ebd7dbb9ecd6a7f4a655a52 (diff)
downloadopencode-d16ae1fc4e6732dfb0d497f389f10c5ab04c253a.tar.gz
opencode-d16ae1fc4e6732dfb0d497f389f10c5ab04c253a.zip
bash truncate character max instead of line max
-rw-r--r--packages/opencode/src/tool/bash.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/opencode/src/tool/bash.ts b/packages/opencode/src/tool/bash.ts
index 4e54d798a..44106b2e9 100644
--- a/packages/opencode/src/tool/bash.ts
+++ b/packages/opencode/src/tool/bash.ts
@@ -12,6 +12,7 @@ import { Wildcard } from "../util/wildcard"
import { $ } from "bun"
import { Agent } from "../agent/agent"
+const MAX_OUTPUT_LENGTH = 30_000
const DEFAULT_TIMEOUT = 1 * 60 * 1000
const MAX_TIMEOUT = 10 * 60 * 1000
@@ -153,10 +154,9 @@ export const BashTool = Tool.define("bash", {
},
})
- const lines = output.split("\n")
- if (lines.length > 1000) {
- output = lines.slice(0, 1000).join("\n")
- output += "\n\n(Ouput was truncated)"
+ if (output.length > MAX_OUTPUT_LENGTH) {
+ output = output.slice(0, MAX_OUTPUT_LENGTH)
+ output += "\n\n(Output was truncated due to length limit)"
}
return {