You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(desktop): WSL is not offered or started when only the Windows install stub exists - #40918
On Windows without WSL, the install stub System32\wsl.exe that Windows always ships made T3 Code treat WSL as installed. Settings offered WSL-only, and with it on, every launch spent about 80 seconds retrying a WSL backend that could never start, opening Windows' 'install WSL' prompt each time. makeIsAvailable now also requires a registered WSL service (WSLService for Store/MSI WSL, LxssManager for the inbox feature), read with reg.exe query without running wsl.exe. On a machine without WSL, the app hides the WSL option and starts on Windows straight away.
Commit f10e1eb (origin/main), on a pool Windows Server 2025 machine. Ran wsl.exe --uninstall so only the System32\wsl.exe stub remained; it prints 'The Windows Subsystem for Linux is not installed' and exits 1. Built the desktop app (vp i, vp run build:desktop) and saved <T3CODE_HOME>\userdata\desktop-settings.json as {"wslBackendEnabled":true,"wslOnly":true}, the state the Settings WSL toggles persist. Launched node scripts\start-electron.mjs on the interactive desktop. Seen: the primary backend failed preflight 12 times between 15:26:03 and 15:27:20 (about 77 s, backoff up to 10 s), each time with 'Unable to list WSL distributions: wsl.exe --list --verbose exited with code 1'. Every attempt opened a Windows Terminal: 'Windows Subsystem for Linux must be updated ... Press any key to install Windows Subsystem for Linux'. The 'T3 Code could not start' recovery window showed only Open releases / Copy details / Quit, with no option to start without WSL. After attempt 12 the log said 'primary WSL preflight retry window exhausted; using Windows for this launch' and a modal 'WSL backend is still unavailable ... T3 Code will use the Windows backend for this launch and retry WSL the next time the app starts' dialog appeared. After it was dismissed, the Windows backend became ready and the main window opened. Afterwards desktop-settings.json held only mainWindowBounds: the in-memory fallback was written to disk by the window-bounds save (the leak PR #26063 describes), not by an explicit choice. Captures: https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/98578fc473b8313e/crop-recovery.pnghttps://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/6c74c8229f81630b/crop-wslprompt.pnghttps://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/f4b5100d10455dc6/crop-dialog.png
Evidence
On Windows Server 2025, uninstall WSL while retaining the System32 stub, save both WSL flags as true in fresh app data, and launch each built desktop app without further input. Both recordings use the same 1920x1080 desktop, light theme, and 110-second observation window.
Stills are unobscured app-window captures, stable across a 500 ms pair. Videos retain real-time playback; machine names and local log paths are masked.
Settings toggle availability and machines with working Store or inbox WSL installations were not exercised; this proof covers startup from persisted WSL-only settings with WSL absent.
The base fallback modal was not dismissed, so subsequent fallback settings persistence was not evaluated.
Tests
vp test run src/wsl/DesktopWslEnvironment.test.ts (apps/desktop): 21 passed; the new stub-only case fails against main's makeIsAvailable
vp run check:changed: format, lint, knip, typecheck (2 packages) and the test file all pass
Manual on Windows Server 2025: reg.exe query for the WSLService key gives 0 with WSL installed; after wsl.exe --uninstall both WSL service keys give 1 while System32\wsl.exe remains; Node's spawnSync of reg.exe query returns the same exit codes
runWslPreflight still marks a non-zero exit from wsl.exe --list --verbose as retryable (fatal: false), so WSL that breaks after the app starts still goes through the retry window.
The startup recovery window has no 'start without WSL' action while the WSL primary is retrying.
isAvailable is cached when the app starts, so installing or removing WSL while the app is open takes effect only after a restart.
…tall stub exists
System32\wsl.exe ships on Windows without WSL and only prompts to install
it, so detecting WSL by that file let Settings offer WSL-only and made
startup retry a WSL primary that could never start. Detect the Store WSL
package or the inbox WSL service instead.
Fixes#40910
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…still count
Probing Program Files\WSL and System32\lxss missed Store-packaged WSL,
whose binaries live under WindowsApps. Keep main's System32\wsl.exe check
and additionally require the WSLService (Store/MSI) or LxssManager (inbox)
service key, which the install stub alone does not have.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No actionable comments were generated in the recent review.
Walkthrough
WSL availability detection now checks the Windows registry for a registered WSL service after confirming that the platform is Windows and wsl.exe exists. Tests cover successful and unsuccessful service-key matches.
The availability check queries for the WSLService and LxssManager registry keys in parallel, with a five-second timeout. It returns unavailable if neither query succeeds. The tests simulate registry results and check both matching and non-matching keys.
pingdotgg/t3code#27723 — This issue describes the same availability gap: the wsl.exe stub can exist without an installed WSL service.
Possibly related PRs
pingdotgg/t3code#27734 — Both PRs change WSL availability behavior on Windows hosts without WSL, using different detection mechanisms.
Suggested labels:bugfix
Suggested reviewers:macroscopeapp
Merge Risk: Minimal · up to 3f77e
This change stops the Windows wsl.exe install stub from being treated as an installed WSL, so the app hides the WSL option and starts normally when WSL is absent. No merge-blocking risk was found.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the fix (WSL is not offered or started when only the Windows install stub exists), and the changeset adds a registry check for WSLService or LxssManager to makeIsAvailable so that Syst…
Linked Issues check
Issue #40910 requires that T3 Code either prevent enabling WSL when WSL is not installed, or offer a startup option to start without WSL. The PR takes the prevention route. In apps/desktop/src/wsl/Des…
Out of Scope Changes check
The whole-PR diff against merge base 2c4310e touches DesktopWslEnvironment.ts (new WSL_SERVICE_KEYS, wslServiceRegistered, makeIsAvailable service check, and the ChildProcessSpawner provision in laye…
Description check
The description covers every required template section. Problem: On Windows without WSL, the System32\wsl.exe install stub made the app treat WSL as installed, which led to repeated retries of a WSL b…
Full details: Title check
Explanation
The title names the fix (WSL is not offered or started when only the Windows install stub exists), and the changeset adds a registry check for WSLService or LxssManager to makeIsAvailable so that System32\wsl.exe alone no longer counts as installed. The title is specific and matches the main change. It uses a conventional commit prefix and is 85 characters long, which is slightly above the typical length but still readable.
Full details: Linked Issues check
Explanation
Issue #40910 requires that T3 Code either prevent enabling WSL when WSL is not installed, or offer a startup option to start without WSL. The PR takes the prevention route. In apps/desktop/src/wsl/DesktopWslEnvironment.ts, makeIsAvailable still checks System32\wsl.exe, then requires a successful reg.exe query for HKLM\SYSTEM\CurrentControlSet\Services\WSLService or ...\LxssManager (run in parallel, 5 s timeout, errors resolve to false). The layer caches this result. When only the install stub exists, availability is false, so the WSL option is hidden and the app starts on Windows. The new test case covers the stub-only state and the inbox-key match. The retry-after-start path, the lack of a start-without-WSL action, cached availability, and the window-bounds leak are not part of #40910's stated not-installed case. The PR description lists them as deferred, so they do not fail this check. Reproduction and manual evidence claims come from the PR text and were not re-run here.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against merge base 2c4310e touches DesktopWslEnvironment.ts (new WSL_SERVICE_KEYS, wslServiceRegistered, makeIsAvailable service check, and the ChildProcessSpawner provision in layer) and DesktopWslEnvironment.test.ts (simulated reg.exe results and a new availability test). Each change supports the availability requirement for #40910. The spawner is needed for reg.exe, and the test support is needed to verify the change. No unrelated code changes were found in the reviewed diff.
Full details: Description check
Explanation
The description covers every required template section. Problem: On Windows without WSL, the System32\wsl.exe install stub made the app treat WSL as installed, which led to repeated retries of a WSL backend that could not start. Change: makeIsAvailable now also requires a registered WSL service (WSLService or LxssManager), read with reg.exe query, without running wsl.exe. Scope: it links issue #40910 as a bug fix. Verification: it lists focused test results (21 passed, with a new stub-only case that fails on main), check:changed results, and manual Windows Server 2025 registry checks. It also gives before/after evidence and states what was not shown. It names the model and harness that did the work. The Problem section gives reproduction steps and environment. The description is thorough and follows the template. The title line is not part of the provided text, so the conventional commit title cannot be confirmed.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:M30-99 changed lines (additions + deletions).vouch:trustedAuthor is trusted by repo permissions or the VOUCHED list.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Windows without WSL, the install stub
System32\wsl.exethat Windows always ships made T3 Code treat WSL as installed. Settings offered WSL-only, and with it on, every launch spent about 80 seconds retrying a WSL backend that could never start, opening Windows' 'install WSL' prompt each time.makeIsAvailablenow also requires a registered WSL service (WSLServicefor Store/MSI WSL,LxssManagerfor the inbox feature), read withreg.exe querywithout runningwsl.exe. On a machine without WSL, the app hides the WSL option and starts on Windows straight away.Fixes #40910
Reproduction on main
Commit f10e1eb (origin/main), on a pool Windows Server 2025 machine. Ran
wsl.exe --uninstallso only the System32\wsl.exe stub remained; it prints 'The Windows Subsystem for Linux is not installed' and exits 1. Built the desktop app (vp i,vp run build:desktop) and saved <T3CODE_HOME>\userdata\desktop-settings.json as {"wslBackendEnabled":true,"wslOnly":true}, the state the Settings WSL toggles persist. Launchednode scripts\start-electron.mjson the interactive desktop. Seen: the primary backend failed preflight 12 times between 15:26:03 and 15:27:20 (about 77 s, backoff up to 10 s), each time with 'Unable to list WSL distributions: wsl.exe --list --verbose exited with code 1'. Every attempt opened a Windows Terminal: 'Windows Subsystem for Linux must be updated ... Press any key to install Windows Subsystem for Linux'. The 'T3 Code could not start' recovery window showed only Open releases / Copy details / Quit, with no option to start without WSL. After attempt 12 the log said 'primary WSL preflight retry window exhausted; using Windows for this launch' and a modal 'WSL backend is still unavailable ... T3 Code will use the Windows backend for this launch and retry WSL the next time the app starts' dialog appeared. After it was dismissed, the Windows backend became ready and the main window opened. Afterwards desktop-settings.json held only mainWindowBounds: the in-memory fallback was written to disk by the window-bounds save (the leak PR #26063 describes), not by an explicit choice. Captures: https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/98578fc473b8313e/crop-recovery.png https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/6c74c8229f81630b/crop-wslprompt.png https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/f4b5100d10455dc6/crop-dialog.pngEvidence
On Windows Server 2025, uninstall WSL while retaining the System32 stub, save both WSL flags as true in fresh app data, and launch each built desktop app without further input. Both recordings use the same 1920x1080 desktop, light theme, and 110-second observation window.
Stills are unobscured app-window captures, stable across a 500 ms pair. Videos retain real-time playback; machine names and local log paths are masked.
Reproduction and capture driver · Export and privacy-mask script · Runtime transcript · Base log · Head log
Not shown:
Tests
vp test run src/wsl/DesktopWslEnvironment.test.ts(apps/desktop): 21 passed; the new stub-only case fails against main'smakeIsAvailablevp run check:changed: format, lint, knip, typecheck (2 packages) and the test file all passreg.exe queryfor the WSLService key gives 0 with WSL installed; afterwsl.exe --uninstallboth WSL service keys give 1 while System32\wsl.exe remains; Node's spawnSync ofreg.exe queryreturns the same exit codesNot in this change
wsl.exe --list --verboseas retryable (fatal: false), so WSL that breaks after the app starts still goes through the retry window.Who did the work
Run by the t3code factory in T3 Code.