fix(gateway): refine handshake timeout comment

This commit is contained in:
Cursor Agent 2026-03-15 14:06:10 +00:00
parent 64de57bc22
commit c2c7087fc8
No known key found for this signature in database

View File

@ -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