fix(cli): keep run event stream alive (#43348)

Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com>
This commit is contained in:
opencode-agent[bot] 2026-08-18 23:31:26 -05:00 committed by GitHub
parent f6f64d7ece
commit d5bf8799c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,