fix(openai): keep websocket response timeouts active (#29699)

This commit is contained in:
Luke Parker
2026-05-28 18:28:01 +10:00
committed by GitHub
parent 14e0b9b17f
commit 913659890d
2 changed files with 29 additions and 19 deletions

View File

@@ -159,9 +159,6 @@ export function streamResponsesWebSocket(options: StreamResponsesWebSocketOption
if (!options.idleTimeout) return
if (idleTimer) clearTimeout(idleTimer)
idleTimer = setTimeout(() => invalidate(new ProviderError.ResponseStreamError(message)), options.idleTimeout)
if (typeof idleTimer === "object" && "unref" in idleTimer && typeof idleTimer.unref === "function") {
idleTimer.unref()
}
}
async function onMessage(data: WebSocket.RawData, isBinary: boolean) {