Repository navigation
Description
Summary
/browse is completely broken on Windows 11. The compiled browse.exe (Bun binary) cannot start or detect the browse server process, making all browse commands fail immediately with:
[browse] Another instance is starting the server, waiting...
[browse] Timed out waiting for another instance to start the server
This happens on fresh install with zero configuration. Every browse command fails, including browse --version.
Root Cause
The isProcessAlive() function in browse/src/cli.ts uses process.kill(pid, 0) to check if the server PID is alive. On Windows, Bun's compiled binary cannot reliably signal Windows-native process IDs this way. The call throws ESRCH even for running processes.
This causes a cascade failure in ensureServer():
isProcessAlive(state.pid)returnsfalseeven when server is healthy- Skips the HTTP health check entirely (line 240 guard)
- Falls through to lock acquisition, which also fails
- Prints "Another instance is starting the server" and times out
The server itself works fine. When started manually via node server-node.mjs, it launches Chromium, responds to health checks, and processes commands via HTTP. The bug is purely in the CLI's process detection.
Reproduction
- Install gstack on Windows 11
- Run any browse command:
~/.claude/skills/gstack/browse/dist/browse goto https://example.com - Observe timeout error
Evidence
# Server starts fine manually:
$ BROWSE_STATE_FILE="$(pwd)/.gstack/browse.json" node ~/.claude/skills/gstack/browse/dist/server-node.mjs
[browse] Server running on http://127.0.0.1:33668 (PID: 19992)
# Health endpoint works:
$ curl http://127.0.0.1:33668/health
{"status":"healthy","uptime":3,"tabs":1,"currentUrl":"about:blank"}
# Commands work via direct HTTP:
$ curl -X POST http://127.0.0.1:33668/command -d '{"command":"goto","args":["https://example.com"]}'
Navigated to https://example.com (200)
# But browse.exe can't detect the running server:
$ browse goto https://example.com
[browse] Another instance is starting the server, waiting...
[browse] Timed out waiting for another instance to start the server
# Bun's process.kill fails for the Windows PID:
$ bun -e "process.kill(19992, 0)" # ESRCH even though process is runningSuggested Fix
In ensureServer(), try the HTTP health check before (or regardless of) the PID alive check. The health check already exists but is gated behind isProcessAlive():
// Current (broken on Windows):
if (state && isProcessAlive(state.pid)) {
// health check here - never reached on Windows
}
// Fix: try health check if state exists, regardless of PID signal
if (state) {
try {
const resp = await fetch(`http://127.0.0.1:${state.port}/health`, {
signal: AbortSignal.timeout(2000),
});
if (resp.ok) {
const health = await resp.json() as any;
if (health.status === 'healthy') return state;
}
} catch {}
}Same pattern should apply in the wait loop (line 273) and the under-lock re-check (line 282).
Environment
- OS: Windows 11 Pro 10.0.26200
- gstack: v0.9.8.0
- Bun: 1.3.9
- Node: v24.12.0
- Shell: Git Bash (MSYS2)
Activity
tan00 commentedon Mar 23, 2026
me too
nwitthaus commentedon Mar 23, 2026
I'm hitting a related but slightly different symptom on Windows 11 with gstack v0.11.5.2.
My symptom: Instead of timing out, the CLI reports success (Navigated to https://example.com (200)) but the page never
actually loads — url returns about:blank and html returns (39 chars). The
server's Chromium crashes immediately after startup.
How I found the root cause: Running the server in the foreground revealed the crash:
$ export BROWSE_STATE_FILE="/.gstack/browse.json"
$ node browse/dist/server-node.mjs
[browse] Server running on http://127.0.0.1:48246 (PID: 13268)
[browse] State file: .../.gstack/browse.json
[browse] Idle timeout: 1800s
[browse] FATAL: Chromium process crashed or was killed. Server exiting.
Key evidence that Playwright itself is fine: Running this directly works perfectly — navigates, returns the full page
title and content:
node -e "
const { chromium } = require('playwright');
(async () => {
const browser = await chromium.launch({ headless: true });
const page = await (await browser.newContext()).newPage();
await page.goto('https://example.com');
console.log('Title:', await page.title());
console.log('Content length:', (await page.content()).length);
await browser.close();
})();
"
// Output:
// Title: Example Domain
// Content length: 1256
So the issue isn't Playwright or Chromium — it's how the Bun-compiled CLI spawns the Node server process. My theory:
Bun.spawn() + proc.unref() on Windows doesn't truly detach the child process. When the Bun CLI exits, the Node server
(and its Chromium grandchild) get killed as part of the process tree.
What I see in the code (cli.ts:177-183):
const proc = Bun.spawn(serverCmd, {
stdio: ['ignore', 'pipe', 'pipe'],
env: { ...process.env, BROWSE_STATE_FILE: config.stateFile },
});
proc.unref();
The CLI writes the state file, confirms the PID is alive, then exits. By the time the next CLI invocation reads the
state file and sends a command, Chromium has already crashed.
Environment:
fix: Windows browse — health-check-first ensureServer, detached start…
fix: Windows browse — health-check-first ensureServer, detached start…
fix: Windows browse — health-check-first ensureServer, detached start…
fix: Windows browse — health-check-first ensureServer, detached start…
fix: Windows browse — health-check-first ensureServer, detached start…
Merge pull request garrytan#342 from kaizen-38/feat/bug-fix
fix: Windows browse — health-check-first ensureServer, detached start…