Commit 3b9b342
committed
fix(bcode-browser): detect compiled mode on Windows; pre-flight harnessDir
The bunfs root is /$bunfs/ on POSIX but B:\~BUN\ on Windows (native
separators), so `__dirname.startsWith("B:/~BUN/")` was always false in
Windows compiled binaries. Result: isCompiled=false, resolveHarnessDir
returned the dev path which doesn't exist on installs, the harness was
never extracted, and every spawn failed with cwd=ENOENT. Bun's spawn
attributes that ENOENT to path="uv", so isUvMissing matched and the
agent reported a misleading 'uv not on PATH' error -- even though uv
was installed and on PATH.
Two fixes:
1. harness.ts: normalize __dirname to forward slashes before the bunfs
prefix check, so the same comparison works on Windows and POSIX.
2. browser-execute.ts: fs.access(harnessDir) before spawn. If the
directory is missing, fail with a clear message instead of falling
into the spawn-ENOENT path that gets misclassified as uv-missing.
Reproduced on Windows 11 with v0.0.5 binary (and a locally-built one).
Pre-fix: ~/.cache/bcode/harness was never created; agent reported uv
missing despite uv being installed and on PATH.
Post-fix: harness extracts on first run, agent attaches to Chrome,
end-to-end browser_execute works.1 parent 46afdba commit 3b9b342
2 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
41 | 49 | | |
42 | 50 | | |
43 | 51 | | |
| |||
0 commit comments