fix(browser-execute): resolve uv to absolute path before spawn#16
Merged
Alezander9 merged 1 commit intomainfrom Apr 28, 2026
Merged
fix(browser-execute): resolve uv to absolute path before spawn#16Alezander9 merged 1 commit intomainfrom
Alezander9 merged 1 commit intomainfrom
Conversation
Windows users hit ENOENT when uv is installed but %USERPROFILE%\.local\bin isn't on the bcode process PATH (User-PATH writes by the uv installer aren't picked up until full re-login by GUI-launched processes). Probe PATH then a per-platform allowlist; fall back to bare 'uv' so the existing UV_MISSING_HINT path still fires when uv is genuinely absent. Memoized via Effect.cached, bound once at make().
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, the uv installer writes
%USERPROFILE%\.local\bininto the User PATH registry key. GUI-launched processes (Cursor / VSCode terminal, double-clickedbcode.exe) don't pick up that change until a full re-login. Result:uv --versionworks in the user's shell butbrowser_executespawnsuvand gets ENOENT, surfacing as exit 127 with the 'uv is not installed' hint despite uv being installed.Fix
New
packages/bcode-browser/src/uv-locate.tsprobesprocess.env.PATH(with platform-correct extensions on Windows) then a per-platform allowlist of well-known install dirs:%USERPROFILE%\.local\bin,%LOCALAPPDATA%\uv\bin,%LOCALAPPDATA%\Programs\uv~/.local/bin,~/.cargo/bin,/opt/homebrew/bin,/usr/local/binOn miss, returns bare
"uv"so the existingUV_MISSING_HINT/ exit 127 path still fires when uv is genuinely absent.Memoized via
Effect.cached, bound once atmake()so the fs probe runs at most once per process.UV_MISSING_HINTextended with the Windows installer command and a 'restart your terminal' note for the freshly-installed-on-Windows case.Why this shape
Considered four options:
process.env.PATHat startup — global side effect for one tool's benefit. Rejected.Pure addition in
packages/bcode-browser/. Level 1 per decisions §1c. No upstream diff.Verification
bun typecheckpasses from bothpackages/bcode-browserandpackages/opencode.End-to-end Windows verification will happen via release artifact after merge — installer command from AGENTS.md tested against a release built from this branch.