Skip to content

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

Open
UtkarshUsername wants to merge 3 commits into
pingdotgg:mainfrom
UtkarshUsername:fix/wsl-preflight-node-version-check
Open

fix(desktop): Validate WSL node version against engine range after probe success#3621
UtkarshUsername wants to merge 3 commits into
pingdotgg:mainfrom
UtkarshUsername:fix/wsl-preflight-node-version-check

Conversation

@UtkarshUsername

@UtkarshUsername UtkarshUsername commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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

Medium Risk
Changes WSL backend preflight success criteria and fatal-failure handling on the Windows desktop connection path, but the logic is a narrow semver check with no auth or data impact.

Overview
WSL preflight can succeed while the distro’s default Node is too old for the server, which left the app hanging on “Connecting to WSL…” instead of surfacing an error.

The node-pty probe script now prints a nodeVersion: line, and parseNodeVersion reads it from probe stdout (with unit tests). When the probe exits 0, ensureNodePtyImpl compares that version to nodeEngineRange via satisfiesSemverRange; a mismatch returns a fatal failure with an upgrade message so the UI can show the error and fall back to the Windows backend.

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

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 c79a8a9.

UtkarshUsername and others added 2 commits June 30, 2026 23:53
The preflight probe could succeed (exit 0) with a node version outside
the server's engine range because || true in the preamble script
swallows ensure_remote_node_path failures. The probe then returns ok:true
without re-validating, and the server silently exits on
import.meta.main (undefined pre-Node 22), leaving the app stuck on
'connecting to WSL...'.

- Probe script now emits a nodeVersion: line
- parseNodeVersion() extracts major.minor.patch from that line
- ensureNodePtyImpl validates the version against nodeEngineRange
  after exitCode === 0 before returning ok:true
@coderabbitai

coderabbitai Bot commented Jun 30, 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

Run ID: a07d8bc8-9d3a-4f46-9cb3-fc531b881328

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.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Jun 30, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

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.

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

Labels

size:M 30-99 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Windows desktop 0.0.28 gets stuck on connecting to WSL after enabling WSL support

1 participant