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

closed1
main
GitHub fork: fix-t3code-render-glitch
openedAug 1, 2026byZZeus-Deus
View on GitHubTwo-way sync enabledPR last imported 2d ago

Problem

When the host is temporarily resource constrained, a foreground health probe can time out even though the existing session is still valid. Immediately replacing that session can start a reconnect while the same host is still stalled, leaving the client unusable until it recovers.

Fix

Keep the existing desktop/web session after the first foreground probe timeout. A successful probe resets the count, while a second consecutive timeout still triggers normal recovery. Definite probe failures and mobile resume behavior are unchanged.

Testing

  • Focused connection supervisor suite: 35 tests passed
  • Client-runtime typecheck
  • Targeted lint and formatting checks

Model: GPT-5; harness: Codex.


Note

Medium Risk Changes live connection monitoring and reconnect timing in client-runtime; behavior is well-covered by supervisor tests but affects when sessions are replaced under load.

Overview Foreground health probes on application-active no longer tear down the session on a single 15s timeout when the host is briefly stalled. The supervisor keeps the existing lease, logs a warning, and only triggers normal reconnect recovery after two consecutive timeouts (FOREGROUND_PROBE_TIMEOUTS_BEFORE_RECONNECT).

A successful probe resets the counter. Definite probe failures and application-active-probe (mobile, 3s timeout) behavior are unchanged.

Tests cover: one timeout stays connected; two timeouts → backoff/release; success between timeouts resets the count.

Reviewed by Cursor Bugbot for commit 3fdbd155b93f90d9b9e24ca89ed010b3ff097887. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Tolerate transient foreground liveness probe timeouts in EnvironmentSupervisor

  • During application-active wakeups, a single probe timeout no longer triggers a reconnect; the supervisor only reconnects after 2 consecutive timeouts (FOREGROUND_PROBE_TIMEOUTS_BEFORE_RECONNECT = 2).
  • A successful probe resets the timeout counter to 0, so isolated timeouts are always tolerated.
  • application-active-probe signals retain the existing fail-fast behavior on timeout.
  • Two new tests cover consecutive timeout reconnection and counter reset after a successful probe.

Macroscope summarized 3fdbd15.

Added 1 commit

  • fix(client-runtime): tolerate transient foreground probe timeouts3fdbd15
Synced from GitHub

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: 61f1d7d2-365c-4fe9-a512-c2ef24bb1bdd

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Synced from GitHub

Approvability

Verdict: Needs human review

This PR changes runtime behavior for connection supervision - tolerating transient foreground probe timeouts before reconnecting instead of failing immediately. This modifies core connection handling logic and should be reviewed by someone familiar with the supervisor implementation.

You can customize Macroscope's approvability policy. Learn more.

Closing in favor of #8522, which carries the same foreground-probe timeout fix on the current connection supervisor and preserves its updated reconnect behavior. Keeping the review in one place.