From ea0f27dc604b5985037dca13256f99320afad5f3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 01:39:35 +0000 Subject: [PATCH] Clear active client pointer on socket error closure Co-authored-by: Theo Browne --- apps/t3/src/runtimeApiServer.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/t3/src/runtimeApiServer.ts b/apps/t3/src/runtimeApiServer.ts index 035aa8bdf9..bafb80d1d0 100644 --- a/apps/t3/src/runtimeApiServer.ts +++ b/apps/t3/src/runtimeApiServer.ts @@ -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; + } }); });