gstack/browse
harjoth ed48bf850b fix(browse): recover a late-healthy detached daemon instead of a false "failed to start" (#1846)
startServer polls /health for MAX_START_WAIT, then throws "Server failed to
start within Ns" on timeout. But the server is spawned detached + unref'd, so
it keeps booting independently of the CLI's poll loop. On a loaded machine the
daemon can become healthy in the gap between the loop's final tick and the
throw — the very next `browse status` shows it listening and healthy. The probe
timed out; the launch did not.

- Add a final readState() + isServerHealthy() re-check before the timeout throw,
  mirroring the post-loop recovery already in ensureServer(). A genuinely failed
  server stays unhealthy and falls through to the existing error report.
- Make the startup budget overridable via BROWSE_START_TIMEOUT (ms) through a
  new pure, exported resolveStartTimeout() — matching the BROWSE_* tunable
  convention in server.ts — so hosts where even the platform ceiling is too low
  have an escape hatch.

Complements #1732 (which only raised the constant): this removes the
false-negative at the throw site itself, on any platform/load.

Test: browse/test/cli-start-final-healthcheck.test.ts — behavioral coverage of
resolveStartTimeout overrides + a static invariant that the final re-check sits
between the poll loop and the throw.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-02 21:47:39 -07:00
..
bin feat: multi-agent support — gstack works on Codex, Gemini CLI, and Cursor (v0.9.0) (#226) 2026-03-19 18:20:50 -07:00
scripts fix: ngrok Windows build + close CI error-swallowing gap (v0.18.0.1) (#1024) 2026-04-16 13:49:04 -07:00
src fix(browse): recover a late-healthy detached daemon instead of a false "failed to start" (#1846) 2026-06-02 21:47:39 -07:00
test fix(browse): recover a late-healthy detached daemon instead of a false "failed to start" (#1846) 2026-06-02 21:47:39 -07:00
PLAN-snapshot-dropdown-interactive.md fix: snapshot -i auto-detects dropdown/popover interactive elements (#845) 2026-04-05 22:57:45 -07:00
SKILL.md v1.51.0.0 feat: $B memory diagnostic + 4 CDP-resource leak fixes (#1751) 2026-05-27 16:09:38 -07:00
SKILL.md.tmpl v1.28.0.0 feat: browse --headed/--proxy/--navigate + gstack/llms.txt + webdriver-only stealth (#1363) 2026-05-07 20:14:59 -07:00