Skip to content

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

Open
Zeus-Deus wants to merge 1 commit into
pingdotgg:mainfrom
Zeus-Deus:fix-t3code-render-glitch
Open

fix(client-runtime): tolerate transient foreground probe timeouts#5198
Zeus-Deus wants to merge 1 commit into
pingdotgg:mainfrom
Zeus-Deus:fix-t3code-render-glitch

Conversation

@Zeus-Deus

@Zeus-Deus Zeus-Deus commented Aug 1, 2026

Copy link
Copy Markdown

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 3fdbd15. 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.

@coderabbitai

coderabbitai Bot commented Aug 1, 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: 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.

@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 1, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 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.

1 participant