fix(pi): run PATH installation correctly through WSL - #680
Open
CamAnNguyen wants to merge 2 commits into
Open
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
On Windows with Use WSL enabled, Jean could not use an existing PI installation from the selected distro. A typical working installation looked like:
Jean still reported PI not found in System PATH. Choosing Install now could instead report:
The machine did not lack PI, Node, or npm. The failures came from crossing the Windows/WSL boundary inconsistently.
Root cause
Path::exists()on Linux paths such as/home/linuxbrew/.linuxbrew/bin/pi.#!/usr/bin/env nodecould therefore resolve WSL's old/usr/bin/nodeinstead of the matching Linuxbrew/nvm/bun runtime.~/.pi/agent/auth.jsonand provider variables.piinstead of retaining the absolute path found bywsl_which().Solution
resolve PI through
wsl_which()and retain the absolute Linux executable pathuse
resolved_cli_exists()so Linux executables are checked inside the selected distrolaunch resolved WSL PI commands as:
pass the executable and PI arguments as positional parameters, preventing shell interpolation of prompts, paths, model IDs, quotes, metacharacters, or multiline values
use the login environment consistently for status, model listing, one-shot execution, normal chat execution, and provider keys
check PI authentication inside the selected distro
use WSL-aware Linuxbrew/npm/bun package-manager detection
Native Windows behavior remains unchanged when WSL is disabled.
Additional production-build repair
A pre-existing duplicate
diagnosticsfield injean-core/src/chat/antigravity.rsprevented Rust/Tauri production compilation withE0062. The duplicate initializer was removed in this PR so the Windows production build can complete.Validation
Rust tests
cargo test --manifest-path jean-core/Cargo.toml platform::wsl::tests --lib— 31 passedcargo test --manifest-path jean-core/Cargo.toml pi_cli::commands::tests --lib— 3 passedcargo test --manifest-path jean-core/Cargo.toml chat::pi::tests --lib— 19 passedReal Windows → WSL smoke tests
Using
Ubuntu-22.04and Linuxbrew:/home/linuxbrew/.linuxbrew/bin/pipi --versionreturned 0.84.1pi --list-modelscompleted successfully$HOME,$(uname), globs, and multiline values without expansionFrontend
The reported Pierre TypeScript errors came from stale local dependencies:
node_modulescontained@pierre/diffs@1.0.11, whilepackage.jsonandbun.lockrequire1.3.2.After:
validation passed:
bun run typecheck— passedbun run build— passedNo dependency or frontend source change was required; the manifest and lockfile were already correct.
Windows Tauri production build
With the MSVC linker selected explicitly because Git's unrelated
link.exeshadows it in this shell:src-tauri/target/release/jean.exeJean_0.1.73_x64_en-US.msiJean_0.1.73_x64-setup.exeThe command then stopped only at updater signing because this local environment does not have
TAURI_SIGNING_PRIVATE_KEY. Compilation and both Windows installer bundles completed successfully.Scope note
WSL custom-provider
models.jsonstorage remains host-home based. That is a separate pre-existing integration gap and is not required for using an already installed/authenticated WSL PI through System PATH.