Skip to content

fix(desktop): restore Node discovery for WSL providers - #11741

Merged
juliusmarminge merged 1 commit into
pingdotgg:mainfrom
akj:fix/wsl-provider-node-path
Sep 14, 2026
Merged

juliusmarminge merged 1 commit into
pingdotgg:mainfrom
akj:fix/wsl-provider-node-path

Conversation

@akj

@akj akj commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

What changed

Codex can become unavailable after upgrading the Windows nightly when the WSL environment uses nvm-managed Node. The standalone T3 backend starts, but its PATH omits Linux Node needed by provider launchers. In the observed pnpm installation, the launcher falls back to Windows Node and exits before initialization. npm's Linux launcher also needs Node on PATH, so changing package managers does not address the missing-Node cause.

Restore the existing version-manager discovery before the packaged WSL runtime captures PATH. Discovery is best effort, so standalone T3 still starts without Node or bash.

Fixes #11740.

Why

#11511 removed the Node dependency for the T3 executable, but provider CLIs can still depend on Node. Reuse the existing discovery code that the mounted runtime already runs.

Validation

  • The new regression test failed before the fix. All 79 tests in DesktopWslEnvironment.test.ts and DesktopBackendConfiguration.test.ts pass with it, including startup without Node and fallback without bash.
  • Desktop typecheck, targeted lint and formatting, and the desktop bundle build pass.
  • Ran T3's actual checkCodexProviderStatus inside Ubuntu using the running server's environment and working directory. Before the fix it reproduced the exit-code-1 error. With only the patched probe's PATH applied, Codex 0.154.0 reported authenticated and ready, with six models and 17 skills.
  • The installed desktop was not replaced or restarted. The desktop UI reconnect flow remains untested.

Checklist

  • This PR is small and focused.
  • The description explains what changed and why.
  • No UI changes requiring screenshots or video.

GPT-6 via Codex.

Summary by CodeRabbit

  • Bug Fixes
    • Improved WSL environment detection to recognize Node installations managed by tools such as nvm.
    • WSL runtime readiness no longer depends on Node being available, while provider command-line tools can still use version-managed Node when present.
    • Preserved the inherited PATH when shell-based environment discovery is unavailable.
    • Updated runtime checks to account for bundled Node and node-pty dependencies.

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

ghost commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved at a30ca4e

Macroscope's review found this PR approvable — This is a focused WSL runtime bug fix with isolated production logic and targeted regression coverage, without product-default or static-analysis configuration changes. An unresolved high-severity finding about not passing the server Node engine range remains a material correctness risk to address.

Notes:

  • This verdict was updated automatically after the outstanding correctness findings were resolved. Macroscope did not re-review the code.

You can add or adjust custom eligibility rules. Learn more.

@coderabbitai

ghost commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: e317bdb5-e0d7-4e75-9e8f-ed0ca885eed2

📥 Commits

Reviewing files that changed from the base of the PR and between 9375c77 and a30ca4e.

📒 Files selected for processing (4)
  • apps/desktop/src/backend/DesktopBackendConfiguration.test.ts
  • apps/desktop/src/backend/DesktopBackendConfiguration.ts
  • apps/desktop/src/wsl/DesktopWslEnvironment.test.ts
  • apps/desktop/src/wsl/DesktopWslEnvironment.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The WSL runtime probe now resolves version-managed Node before capturing PATH for provider CLIs. Node remains optional for standalone runtime readiness. Tests cover nvm discovery, missing Node, and unavailable bash.

Changes

WSL runtime PATH resolution

Layer / File(s) Summary
Runtime probe resolution
apps/desktop/src/wsl/DesktopWslEnvironment.ts, apps/desktop/src/backend/DesktopBackendConfiguration.ts
The exported buildWslRuntimeProbeScript resolves version-managed Node before capturing PATH. probeWslRuntimeImpl continues to use resolveNode: false. Comments state that the staged runtime supplies its own Node and node-pty.
Probe regression coverage
apps/desktop/src/wsl/DesktopWslEnvironment.test.ts, apps/desktop/src/backend/DesktopBackendConfiguration.test.ts
Tests cover nvm-based Node discovery, readiness without Node, inherited PATH fallback when bash is unavailable, and the staged runtime's node-pty contract.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: juliusmarminge

Merge Risk: ⚪ Minimal · up to a30ca

The WSL runtime probe change includes coverage for version-managed Node discovery and fallback behavior, with no concrete merge-blocking issue identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed For #11740, buildWslRuntimeProbeScript now runs the shared buildWslNodeEnvPreamble() before it captures PATH. probeRuntimeImpl uses this script while keeping resolveNode: false, so the staged …
Out of Scope Changes check ✅ Passed The changes stay within #11740. The source change restores WSL PATH discovery, the tests provide regression coverage, and the comment updates clarify the runtime and node-pty requirements. No unrelate…
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4…
Title check ✅ Passed The title clearly and concisely describes the main change: restoring Node discovery for WSL providers.
Description check ✅ Passed The description explains what changed, why it changed, validation performed, linked issue context, and checklist status. The UI section is omitted appropriately because the PR has no UI changes.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

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.

WSL Codex fails after nightly update when Node is managed by nvm

2 participants