fix(opencode): advertise configured shell timeout (#28998)

Co-authored-by: Nabs <nabil@instafork.com>
This commit is contained in:
Aiden Cline
2026-05-23 10:43:39 -05:00
committed by GitHub
co-authored by Nabs
parent 387c5a02c8
commit ba437069e6
3 changed files with 36 additions and 19 deletions
+3 -3
View File
@@ -340,7 +340,7 @@ export const ShellTool = Tool.define(
const trunc = yield* Truncate.Service
const plugin = yield* Plugin.Service
const flags = yield* RuntimeFlags.Service
const defaultTimeout = flags.bashDefaultTimeoutMs ?? 2 * 60 * 1000
const defaultTimeoutMs = flags.bashDefaultTimeoutMs ?? 2 * 60 * 1000
const cygpath = Effect.fn("ShellTool.cygpath")(function* (shell: string, text: string) {
const lines = yield* spawner
@@ -601,7 +601,7 @@ export const ShellTool = Tool.define(
const shell = Shell.acceptable(cfg.shell)
const name = Shell.name(shell)
const limits = yield* trunc.limits()
const prompt = ShellPrompt.render(name, process.platform, limits)
const prompt = ShellPrompt.render(name, process.platform, limits, defaultTimeoutMs)
log.info("shell tool using shell", { shell })
return {
@@ -616,7 +616,7 @@ export const ShellTool = Tool.define(
if (params.timeout !== undefined && params.timeout < 0) {
throw new Error(`Invalid timeout value: ${params.timeout}. Timeout must be a positive number.`)
}
const timeout = params.timeout ?? defaultTimeout
const timeout = params.timeout ?? defaultTimeoutMs
const ps = Shell.ps(shell)
yield* Effect.scoped(
Effect.gen(function* () {