The open source coding agent.
TypeScript
fix: timeout param that allows user to disable provider timeout (#3443)
Paulo Edgar Castroae62bc8b1fce
diff --git a/packages/opencode/src/provider/provider.ts b/packages/opencode/src/provider/provider.tsindex 7c40955dc33..b2f2e5d405a 100644--- a/packages/opencode/src/provider/provider.ts+++ b/packages/opencode/src/provider/provider.ts@@ -422,14 +422,14 @@ export namespace Provider {const modPath =provider.id === "google-vertex-anthropic" ? `${installedPath}/dist/anthropic/index.mjs` : installedPathconst mod = await import(modPath)- if (options["timeout"] !== undefined) {+ if (options["timeout"] !== undefined && options["timeout"] !== null) {// Only override fetch if user explicitly sets timeoutoptions["fetch"] = async (input: any, init?: BunFetchRequestInit) => {const { signal, ...rest } = init ?? {}const signals: AbortSignal[] = []if (signal) signals.push(signal)- signals.push(AbortSignal.timeout(options["timeout"]))+ if (options["timeout"] !== false) signals.push(AbortSignal.timeout(options["timeout"]))const combined = signals.length > 1 ? AbortSignal.any(signals) : signals[0]