Clear active client pointer on socket error closure

Co-authored-by: Theo Browne <[email protected]>
This commit is contained in:
Cursor AgentandTheo Browne committed 2026-02-10 01:39:35 +00:00
1 parent d3f580dc95
commit ea0f27dc60
1 file changed
+3
+3
View File
@@ -708,6 +708,9 @@ export async function startRuntimeApiServer(
socket.on("error", () => {
// Connection-level protocol/socket errors are expected occasionally
// (for example oversized client payloads). Keep server process alive.
if (activeClient === socket && socket.readyState !== WebSocket.OPEN) {
activeClient = null;
}
});
});