Repository navigation
fix(webui): build process arguments as arrays instead of shell strings - #6898
Conversation
The Electron launcher and backend installer assembled four commands as shell strings (opening the browser, the PATH lookup, and both free-space probes). They now pass an argument array to spawn/spawnSync/execFileSync with no shell, so a URL or path reaches the program as one argument. Closes #2950
|
Verdict: Approve with suggestions The launcher and desktop installer now hand URLs and paths to the browser opener, the PATH lookup and the disk-space probes as single arguments with no shell, so a home folder or URL with spaces, quotes or Two small things are worth doing before merge:
Real-world evidenceThe evidence stage ran on a Linux runner against the real launcher, The Windows paths ( 🔍 Technical details🟡 New Windows subprocesses don't set Also add 🟢 Checked, no issue
Strengths
|
Minimal Linux installs ship no `which`, so uv and gaia read as missing. The PATH lookup now runs `sh -c 'command -v "$1"'` with the name as $1, and a lookup that can't run at all raises an InstallError naming the fix instead of reporting the tool as absent. The Windows lookup and the PowerShell disk probe no longer flash a console window.
Brings in amd#6898's argv-array process calls. The installer keeps main's execFileSync import and drops the now-unused crypto import, since the frozen-core path no longer downloads or verifies a bundled uv; the bundled-core Jest mock now stubs execFileSync instead of execSync.
The Electron launcher and backend installer built four of their commands as shell strings: opening the browser, checking whether a tool is on PATH, and the two free-disk-space probes. They now pass process arguments as arrays with no shell, so a URL or a path with spaces or unusual characters reaches the program as a single argument instead of being re-parsed.
Closes #2950
Test plan
cd tests/electron && npx jest process-argv backend-installer gaia-ui— new tests assert the exact argv andshell: falsefor each call, including a home path with spaces and shell metacharacters (asserted on the argv, nothing executed)npx tsc --noEmitandnpx vitest runinsrc/gaia/apps/webuinpx @amd-gaia/agent-ui(ornode bin/gaia-ui.cjs) opens the browser on the right URL on Windows, macOS and Linuxuvandgaiaon PATH