Repository navigation
Description
Summary
On WSL (Ubuntu on Windows), browse goto <url> hangs indefinitely at [browse] Starting server... even though the compiled binary and server are functional individually. Two independent root causes discovered.
Environment
- WSL2 (Ubuntu 24.04) on Windows 11
- gstack v0.11.18.2 (freshly upgraded from 0.3.7)
- Bun 1.3.11
- Chromium (ms-playwright) available and working
Root Cause 1: Bun.spawn stdio pipe hang
The compiled browse binary successfully spawns bun run server.ts (verified via pstree — full process tree with bun + chrome-headless visible). However, the parent process (CLI) never receives the "server ready" signal via the stdio pipe.
Evidence:
bun run server.tsdirectly: works, state file written in <2snode server-node.mjsdirectly: works- Compiled binary's
Bun.spawn(['bun', 'run', SERVER_SCRIPT], { stdio: ['ignore', 'pipe', 'pipe'] }): process tree spawns but CLI hangs waiting on pipe
This appears to be a Bun runtime issue where Bun.spawn inside a bun build --compile binary doesn't properly connect stdio pipes on WSL's filesystem layer.
Root Cause 2: HTTP proxy intercepts localhost health check
WSL environments commonly have HTTP_PROXY set (e.g., for clash/v2ray). The CLI's health check:
curl -sf "http://127.0.0.1:$port/health"
gets routed through the proxy, which returns 502 for localhost. This causes the "wait for healthy" loop to never succeed even if the server is actually running.
Workaround
Replace the compiled binary with a bash wrapper that:
- Starts the server via
nohup bun run server.ts(avoids Bun.spawn pipe issue) - Polls the state file + health endpoint with
--noproxy '*' - Sends commands via HTTP API with
--noproxy '*'
#!/usr/bin/env bash
# Key fixes:
# 1. Use nohup + bun run instead of Bun.spawn
# 2. All curl calls use --noproxy '*'Full wrapper: ~80 lines, available on request or as PR.
Suggested Fix
-
For Bun.spawn hang: The
build_or_wrapapproach in PR fix: fall back to wrappers when bun compile fails #412 partially addresses this. Additionally, the CLI'sstartServer()could detect WSL (uname -r | grep -i microsoft) and usechild_process.spawnwithnode server-node.mjsinstead ofBun.spawn(['bun', 'run', ...]). -
For proxy interception: Add
--noproxy '*'orno_proxy=127.0.0.1,localhostto all internal HTTP calls (health check, command dispatch). This affects WSL, corporate networks, and any environment with HTTP_PROXY set.
Related
- bun build --compile fails on virtiofs mounts (devcontainers) #407 —
bun build --compilefails on virtiofs (same class of issue) - fix: fall back to wrappers when bun compile fails #412 — PR adding wrapper fallback (partial fix for our scenario)
- Windows: browse server fails to start — findPort() race condition in Node.js polyfill #486 — Windows browse server fails (Node.js polyfill race condition)
Activity
time-attack commentedon Jul 15, 2026
@FeilixX WSL browsing still hangs on Bun.spawn pipes, and intercepted localhost traffic remains unresolved until the selected implementation lands.
G4: keep CLI-to-daemon loopback calls off HTTP_PROXY (#494)
v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, ever…
capy-ai commentedon Oct 4, 2026
The browse CLI now appends
127.0.0.1,localhost,::1to your existingNO_PROXYbefore its first loopback call, so anHTTP_PROXYno longer intercepts the daemon health check. Fixed in v1.91.19.0 (#3025).We could only test this on Linux, not on WSL, so I'm leaving the issue open until you can confirm. Could you upgrade (run
/gstack-upgradein Claude Code, or on Codex and other env-var hostscd <source from ./setup --status> && git pull && ./setup --host <host>) and let us know whether it works for you? If you still see this, please add./setup --statusoutput here.capy-ai commentedon Oct 8, 2026
Thanks for the report. This should be fixed in v1.91.19.0 (#3025): the browse daemon is now spawned detached with log-file stdio (no pipes to hang on), and loopback is appended to
NO_PROXYso a proxy no longer intercepts localhost. We couldn't verify it on WSL ourselves.To confirm, upgrade with
/gstack-upgrade(orgit pull && ./setup) to v1.91.34.0 or later, retry, and reply here with the result and the output of~/.claude/skills/gstack/bin/gstack-doctor. If we don't hear back in 14 days, we'll close this as fixed (reopening is always welcome).v1.91.19.0 fix: severe fix wave (truthful gates, no lost memory, ever…
capy-ai commentedon Oct 24, 2026
Closing: nobody reported this again in the two weeks since the Oct 8 confirm-first note. The fix shipped in v1.91.19.0 (#3025): the browse daemon spawns detached with log-file stdio, so there are no pipes to hang on, and loopback is appended to
NO_PROXYso a proxy no longer intercepts localhost. Thanks @FeilixX for the report. If it still happens on the current release (v1.91.186.0 or later), reply with your version and what you saw, and we'll reopen.Record the no-loss replay for gate-tagged data excerpts (GST-3273)