disable SSE body timeouts and ignore workspace-stopped disconnects

This commit is contained in:
Shantur Rathore
2025-11-23 19:34:14 +00:00
parent 48a16a6702
commit dd6efee900

View File

@@ -1,10 +1,12 @@
import { fetch } from "undici"
import { Agent, fetch } from "undici"
import { Agent as UndiciAgent } from "undici"
import { EventBus } from "../events/bus"
import { Logger } from "../logger"
import { WorkspaceManager } from "./manager"
import { InstanceStreamEvent, InstanceStreamStatus } from "../api-types"
const INSTANCE_HOST = "127.0.0.1"
const STREAM_AGENT = new UndiciAgent({ bodyTimeout: 0, headersTimeout: 0 })
const RECONNECT_DELAY_MS = 1000
interface InstanceEventBridgeOptions {
@@ -97,6 +99,7 @@ export class InstanceEventBridge {
const response = await fetch(url, {
headers: { Accept: "text/event-stream" },
signal,
dispatcher: STREAM_AGENT,
})
if (!response.ok || !response.body) {