diff --git a/packages/cli/src/run/run.ts b/packages/cli/src/run/run.ts index 9aea2b9d33..ff1dd57f3e 100644 --- a/packages/cli/src/run/run.ts +++ b/packages/cli/src/run/run.ts @@ -80,7 +80,13 @@ async function run(input: RunCommandInput, options: ExecutionOptions) { } async function execute(input: RunCommandInput, prepared: Prepared, endpoint: Endpoint, options: ExecutionOptions) { - const client = OpenCode.make({ baseUrl: endpoint.url, headers: Service.headers(endpoint) }) + const client = OpenCode.make({ + baseUrl: endpoint.url, + headers: Service.headers(endpoint), + // Bun's default five-minute deadline terminates the event stream used by long-running sessions. + fetch: ((request: RequestInfo | URL, init?: RequestInit) => + fetch(request, { ...init, timeout: false } as BunFetchRequestInit)) as typeof fetch, + }) const explicit = parseRunModel(input.model) const target = await resolveSessionTarget({ client,