Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): Validate WSL node version against engine range after probe success #3621

MergedUtkarshUsername(GitHub profile, opens in a new tab)merged 13 commits intomain fromrefs/pull/3621/headmerged by juliusmarminge View on GitHub

Fixes #3611

What Changed

After the WSL preflight probe succeeds, the app now checks that the WSL Node version satisfies the server's requirement before accepting it as valid.

I tested this by downgrading my WSL node version to 18.19.1. The app correctly showed the failure, and suggested to upgrade node.

Why

When nvm's default Node version (e.g. 18.x) falls outside the server's engine range, the preflight probe still exits successfully and returns a valid node path. The server then silently exits because it can't run on that Node version, leaving the app stuck on "Connecting to WSL…". This adds a missing validation step to catch that case early and show the user a clear error.

Before: image

The app got stuck in "Connecting to WSL…".

After: image

Connecting to WSL fails, error is shown, and then the app falls back to Windows-backend mode.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Low Risk Narrow change to WSL preflight success handling and error messaging; reuses existing semver range checks already used elsewhere in the same module.

Overview Fixes WSL startup hanging on "Connecting to WSL…" when the distro’s default Node is present and the node-pty preflight probe succeeds, but the version is outside the server’s engines.node range.

The WSL node-pty probe script now prints a nodeVersion: line; parseNodeVersion reads it from probe stdout. After probe.exitCode === 0, ensureNodePtyImpl compares that version to options.nodeEngineRange with satisfiesSemverRange. A mismatch returns a fatal failure with an upgrade message instead of treating the backend as healthy. Unit tests cover parseNodeVersion parsing edge cases.

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

Note

[!NOTE]

Validate WSL Node.js version against engine range after probe success

  • Extends the WSL node-pty probe script to output the detected Node.js version (nodeVersion: line) alongside the existing nodePath and resolvedPath lines.
  • Adds parseNodeVersion to extract that version from probe stdout.
  • After a successful probe, ensureNodePtyImpl checks the detected version against options.nodeEngineRange using satisfiesSemverRange, returning a fatal failure if the version does not satisfy the range.
  • Behavioral Change: a previously successful probe can now return a fatal failure when the WSL Node.js version is outside the required engine range.
Macroscope summarized 43693dc. >
    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: bcd06414-28ec-406f-8f98-1b40168fc721

      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:trusted

    3. Approvability

      Verdict: Needs human review

      Introduces a new fatal error pathway for WSL Node.js version validation. Previously-passing probes can now fail if the version doesn't satisfy the engine range. This behavioral change, plus the author being new to this file, warrants human review.

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

      Review failed

      An error occurred during the review process. Please try again later.

      ✨ 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.
    5. juliusmarminge merged thisbf76535

    6. juliusmarminge closed this

Sign in to join this conversation.