Skip to content

fix(client-runtime): tolerate transient foreground probe timeouts - #8522

Closed
Radu028 wants to merge 1 commit into
pingdotgg:mainfrom
Radu028:fix/transient-foreground-probe-timeouts
Closed

fix(client-runtime): tolerate transient foreground probe timeouts#8522
Radu028 wants to merge 1 commit into
pingdotgg:mainfrom
Radu028:fix/transient-foreground-probe-timeouts

Conversation

@Radu028

@Radu028 Radu028 commented Aug 28, 2026

Copy link
Copy Markdown

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

  • This PR is small and focused
  • I explained what changed and why
  • No UI changes

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 for commit 6ace61a6a1ca605e9bd5855fd0927903df3bae9e. Bugbot is set up for automated code reviews on this repo. Configure here.

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.

@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: efcccfd9-0950-4d13-902e-5e649a348478

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:S 10-29 changed lines (additions + deletions). labels Aug 28, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Aug 28, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at 5aa6ec6

Macroscope's review found this PR approvable — This is a small, localized client-runtime bug fix that preserves a desktop/web session through one transient foreground probe timeout and reconnects after two consecutive timeouts. Tests cover the timeout sequence and reset behavior, while mobile and other connection paths remain unchanged.

You can add or adjust custom eligibility rules. Learn more.

@macroscopeapp
macroscopeapp Bot dismissed their stale review August 28, 2026 12:19

Dismissing prior approval to re-evaluate 5aa6ec6

@github-actions github-actions Bot added size:M 30-99 changed lines (additions + deletions). and removed size:S 10-29 changed lines (additions + deletions). labels Aug 28, 2026
@Radu028
Radu028 force-pushed the fix/transient-foreground-probe-timeouts branch from 5aa6ec6 to 6ace61a Compare September 1, 2026 20:25
The supervisor no longer replaces a live desktop or web session after a
single foreground probe timeout. It reconnects after two consecutive
timeouts, and a successful probe resets the count. Consecutive stalls
mark the wake probe as failed before reconnecting, so the existing
skip-backoff behavior is preserved. Mobile resume probes are unchanged.

Fixes pingdotgg#7231

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@t3dotgg

t3dotgg commented Sep 4, 2026

Copy link
Copy Markdown
Member

Note

🤖 GPT-6 Astra (preview) responding on behalf of Theo

This was closed as part of an automated cleanup pass. If you believe it was closed in error, reply here and we will get it reopened.

Closing in favor of #7233, which retries a timed-out foreground probe automatically within a bounded window. This version waits for another visibility change before it probes again, so a stalled RPC session can remain marked connected indefinitely. The replacement preserves the separate mobile resume behavior. Review continues there.

@t3dotgg t3dotgg closed this Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: One slow foreground health probe tears down a live session and disables the composer

2 participants