gstack/browse
TTmo123 897f41cfd9 fix(browse): skip crash-retry when user invokes stop or restart
sendCommand's ECONNRESET handler treats every dropped connection as a
crash and restarts the daemon. But stop and restart are user-initiated
shutdowns: the daemon intentionally closes the HTTP connection before
the response body flushes (meta-commands.ts:423-433). The restart
attempt sends stop again, the new daemon exits again, and retries >= 1
throws 'Server crashed twice in a row — aborting.'

Fix: add a short-circuit check for command === 'stop' || command ===
'restart' at the top of the ECONNRESET handler. When user-intended,
call process.exit(0) to skip main()'s surrounding .catch(), which
would print '[browse] fetch failed' and exit 1.

'command' is already in closure from sendCommand's signature (cli.ts:527).
The recursive calls at cli.ts:596 and :613 pass 'command' explicitly.

Daemon-side handlers (meta-commands.ts) are unchanged. No 'chore:
rebuild' commit — CI's windows-setup-e2e.yml rebuilds browse binary
on every push touching browse/src/cli.ts.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 22:01:35 +08: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): skip crash-retry when user invokes stop or restart 2026-06-28 22:01:35 +08:00
test v1.58.3.0 feat: gbrowser anti-detection Layer C stealth (#2047) 2026-06-18 10:45:05 -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.58.5.0 feat: first-run activation scaffold + gstack router front door (#2078) 2026-06-25 09:42:45 -07:00
SKILL.md.tmpl v1.57.8.0 feat: browse js/eval --out render-to-file (canonical Chromium for offline rendering) (#1929) 2026-06-09 21:02:30 -07:00