diff --git a/src/main/daemon/daemon-pty-adapter.test.ts b/src/main/daemon/daemon-pty-adapter.test.ts index 3c8604a22c3..7a5b5210a1b 100644 --- a/src/main/daemon/daemon-pty-adapter.test.ts +++ b/src/main/daemon/daemon-pty-adapter.test.ts @@ -1273,6 +1273,13 @@ describe('DaemonPtyAdapter (IPtyProvider)', () => { // The rejection is remembered, so later probes skip the round trip that cannot work. expect(request.mock.calls.filter(([type]) => type === 'getSize')).toHaveLength(1) + // Why pinned here: a wedged daemon holds its socket open, so an unbounded getSize would + // stall a pane mount for the client's 30s default instead of answering "unknown" in 2s. + expect(request).toHaveBeenCalledWith( + 'getSize', + { sessionId: 'ambiguous-live' }, + LIVENESS_PROBE_TIMEOUT_MS + ) ambiguous.dispose() }) diff --git a/src/main/daemon/daemon-pty-adapter.ts b/src/main/daemon/daemon-pty-adapter.ts index 2617272110b..1a8e7ce5576 100644 --- a/src/main/daemon/daemon-pty-adapter.ts +++ b/src/main/daemon/daemon-pty-adapter.ts @@ -2442,8 +2442,6 @@ function notifyAuditListeners(listeners: readonly ((value: T) => void)[], val } } -// Why: syscall='connect' distinguishes a dead-socket ENOENT/ECONNREFUSED from token-file ENOENT (no syscall); -// message strings incl. wedged-daemon "Hello response timed out" (#8689) also warrant a respawn. /** * Narrow on purpose: only the daemon's own reply for a request type it does not implement. * A transient failure must stay unproven rather than be mistaken for a missing capability. @@ -2454,6 +2452,8 @@ function isUnknownRequestTypeError(err: unknown): boolean { return err instanceof Error && err.message.includes('Unknown request type') } +// Why: syscall='connect' distinguishes a dead-socket ENOENT/ECONNREFUSED from token-file ENOENT (no syscall); +// message strings incl. wedged-daemon "Hello response timed out" (#8689) also warrant a respawn. function isDaemonGoneError(err: unknown): boolean { if (!(err instanceof Error)) { return false