Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@ export async function runServer(options: RunServerOptions): Promise<void> {
serve({
fetch: server.fetch as ServerHandler,
port: options.port,
// Bun.serve defaults idleTimeout to 10s, which kills any connection with
// no socket activity for 10s. Copilot's /v1/messages holds the response
// (headers and/or mid-stream) for the length of upstream generation, so
// large completions (e.g. a big Claude Code Edit) routinely exceed 10s of
// silence and get cut, surfacing in clients as "Connection closed
// mid-response". 0 disables the timeout entirely.
bun: { idleTimeout: 0 },
})
}

Expand Down