From c2c7087fc8c2665634698e4f182b6d78db6a1ae6 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 15 Mar 2026 14:06:10 +0000 Subject: [PATCH] fix(gateway): refine handshake timeout comment --- src/gateway/server-constants.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gateway/server-constants.ts b/src/gateway/server-constants.ts index da215d2a525..937dcc554ea 100644 --- a/src/gateway/server-constants.ts +++ b/src/gateway/server-constants.ts @@ -21,8 +21,9 @@ export const __setMaxChatHistoryMessagesBytesForTest = (value?: number) => { maxChatHistoryMessagesBytes = value; } }; -// Restore 10s timeout: 3s (from #44089) was too aggressive for CLI on slow systems -// (e.g. device identity load + signature, disk I/O). Fixes #47103. +// Allow sufficient time for CLI to load device identity, sign the connect payload, +// and complete the handshake on slow systems (cold start, disk I/O). Too short causes +// premature close with "gateway closed (1000 normal closure)" before connect completes. export const DEFAULT_HANDSHAKE_TIMEOUT_MS = 10_000; export const getHandshakeTimeoutMs = () => { // User-facing env var (works in all environments); test-only var gated behind VITEST