Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(client): use lightweight connection probe #4137

Mergedeeinarsson(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/4137/headmerged by juliusmarminge View on GitHub

Fixes #3553.

Related to #3911, which addresses initial server.getConfig latency. This PR is narrower: foreground connection health checks no longer invoke configuration hydration at all.

What Changed

  • Add a dedicated server.probe RPC that returns immediately and uses the existing orchestration-read authorization scope.
  • Use that endpoint for client-runtime connection health checks instead of server.getConfig.
  • Keep server.getConfig for initial session configuration hydration.
  • Add focused coverage verifying that initialization loads configuration while subsequent probes use the lightweight endpoint.

Why

When the application becomes active, the connection supervisor currently probes the session through server.getConfig.

That RPC performs configuration and provider discovery work, which can become slow on busy or resource-constrained Windows systems. If it exceeds the 15-second foreground probe timeout, the client treats an otherwise live WebSocket as unavailable, enters reconnecting state, and temporarily disables the composer.

A dedicated no-work RPC separates connection liveness from configuration hydration. This reduces false reconnects without changing initial configuration loading, authorization requirements, or the existing timeout and reconnect policy.

Testing

  • vp test packages/client-runtime/src/rpc/session.test.ts packages/client-runtime/src/connection/supervisor.test.ts — 28 tests passed
  • vp check — passed with 10 unrelated existing web lint warnings
  • vp run typecheck — passed
  • git diff --check — passed

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • UI screenshots are not applicable because there is no UI change
  • An interaction video is not applicable because there is no motion or interaction change

Note

Low Risk Behavior change is limited to probe RPC selection; initial config loading and auth scopes stay the same, with backward compatibility for servers missing the new capability.

Overview Introduces server.probe, a no-op RPC for liveness checks, and advertises it via the optional connectionProbe capability on the execution environment descriptor.

Client-runtime still hydrates the session with server.getConfig on connect, but RpcSession.probe now calls server.probe when the capability is present; older servers without it keep using server.getConfig for probes. The WebSocket server wires the handler with the same orchestration-read scope as other read RPCs.

Tests cover probe vs initial config traffic, legacy fallback, and supervisor behavior on application activation (probe without reconnect).

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit da511a97bb5af75f51c272932826ce776de8e2cc. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Add lightweight server.probe RPC for connection health checks

  • Adds a new server.probe RPC contract (WsServerProbeRpc) with an empty payload and empty success response, authorized under AuthOrchestrationReadScope.
  • RpcSession.probe now calls server.probe when the server reports capabilities.connectionProbe: true, falling back to server.getConfig for legacy servers.
  • The server advertises connectionProbe: true in the ExecutionEnvironmentDescriptor.capabilities returned by ServerEnvironment.make.
  • Behavioral Change: connection probes on capable servers now send a lightweight server.probe request instead of the heavier server.getConfig call.
Macroscope summarized da511a9.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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

      Run ID: 39b38847-d334-4044-971c-70b4c8e2dd11

      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
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      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.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot).

      Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.

      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit f0e42d607524232d7b37370e6b997df96c51c365. Configure [here](https://www.cursor.com/dashboard/bugbot).
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved

      This PR adds a lightweight serverProbe RPC for connection checking instead of using the heavier serverGetConfig. The change is backwards compatible, well-tested, and introduces no significant behavioral changes - the new endpoint simply returns an empty response to verify connectivity.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. juliusmarminge merged this2640e6d

    6. juliusmarminge closed this

Sign in to join this conversation.