What Changed#
The connection supervisor no longer replaces a live desktop or web session after a single foreground health probe timeout. It reconnects only after two consecutive timeouts, and a successful probe resets the count. When it does reconnect, it still skips the first backoff rung, the same as a definite probe failure. Definite probe failures and the mobile resume probe are unchanged.
Why#
Under temporary host load, one slow probe (15s) tore down an otherwise healthy WebSocket, showed "Failed to connect. Reconnecting..." and disabled the composer while the same host was still stalled.
Fixes #7231. Same approach as #5198, which no longer applies to main.
Verification#
vp test run packages/client-runtime/src/connection/supervisor.test.ts (36 passed; covers single-timeout tolerance, reconnect on the second timeout, and reset after a successful probe)
- client-runtime typecheck, targeted lint and fmt
Checklist#
Built with Claude Fable 5.1 in Claude Code.
Note
Medium Risk
Changes connection recovery timing for desktop foreground probes (up to ~30s before reconnect on hung probes) in a core client-runtime path, though definite failures and mobile probes are unchanged.
Overview
Desktop/web foreground health checks no longer tear down a live session on a single 15s probe timeout. EnvironmentSupervisor now requires two consecutive stalled application-active probes before treating the transport as dead and reconnecting (with the same immediate retry behavior as a definite probe failure). A probe that completes successfully resets the timeout counter, and the first timeout only emits a warning while keeping the existing session.
Mobile application-active-probe behavior is unchanged: timeouts still fail fast on the shorter 3s window. Tests were expanded to cover single-timeout tolerance, reconnect on the second timeout, and counter reset after a successful probe.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 6ace61a6a1ca605e9bd5855fd0927903df3bae9e. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
Note
Tolerate transient foreground probe timeouts in EnvironmentSupervisor#
Adds FOREGROUND_PROBE_TIMEOUTS_BEFORE_RECONNECT (set to 2) so the desktop foreground probe tolerates a single timeout before forcing a reconnect. A successful probe resets the timeout counter. Mobile explicit foreground probes (application-active-probe) still fail fast on timeout.
- Risk: desktop reconnects now trigger only after 2 consecutive timeouts instead of 1, so a probe that permanently hangs takes up to 30s to recover; check
foregroundProbeTimeoutCount logic in supervisor.ts.
Macroscope summarized 97442ad.
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
efcccfd9-0950-4d13-902e-5e649a348478You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Comment `@coderabbitai help` to get the list of available commands.