瀏覽代碼

remove max timeout

Aiden Cline 4 月之前
父節點
當前提交
c75dae680a
共有 1 個文件被更改,包括 1 次插入3 次删除
  1. 1 3
      packages/opencode/src/tool/bash.ts

+ 1 - 3
packages/opencode/src/tool/bash.ts

@@ -22,7 +22,6 @@ const MAX_OUTPUT_LENGTH = (() => {
   return Number.isInteger(parsed) && parsed > 0 ? parsed : DEFAULT_MAX_OUTPUT_LENGTH
 })()
 const DEFAULT_TIMEOUT = 1 * 60 * 1000
-const MAX_TIMEOUT = 10 * 60 * 1000
 const SIGKILL_TIMEOUT_MS = 200
 
 export const log = Log.create({ service: "bash-tool" })
@@ -107,7 +106,7 @@ export const BashTool = Tool.define("bash", async () => {
       if (params.timeout !== undefined && params.timeout < 0) {
         throw new Error(`Invalid timeout value: ${params.timeout}. Timeout must be a positive number.`)
       }
-      const timeout = Math.min(params.timeout ?? DEFAULT_TIMEOUT, MAX_TIMEOUT)
+      const timeout = params.timeout ?? DEFAULT_TIMEOUT
       const tree = await parser().then((p) => p.parse(params.command))
       if (!tree) {
         throw new Error("Failed to parse command")
@@ -170,7 +169,6 @@ export const BashTool = Tool.define("bash", async () => {
           for (const arg of command.slice(1)) {
             if (arg.startsWith("-") || (command[0] === "chmod" && arg.startsWith("+"))) continue
             const resolved = await $`realpath ${arg}`
-              .cwd(cwd)
               .quiet()
               .nothrow()
               .text()