fix(client-runtime): tolerate transient foreground probe timeouts - #5198
fix(client-runtime): tolerate transient foreground probe timeouts#5198Zeus-Deus wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: 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. |
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
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-activeno 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 3fdbd15. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Tolerate transient foreground liveness probe timeouts in
EnvironmentSupervisorapplication-activewakeups, a single probe timeout no longer triggers a reconnect; the supervisor only reconnects after 2 consecutive timeouts (FOREGROUND_PROBE_TIMEOUTS_BEFORE_RECONNECT = 2).application-active-probesignals retain the existing fail-fast behavior on timeout.Macroscope summarized 3fdbd15.