gstack/browse
Salim Habash caf8b42a7f fix(bun-polyfill): Bun.spawn parity for proc.exited and stream consumption
The Bun.spawn polyfill omitted `proc.exited`, so eight call sites in
browse/src/ that `await proc.exited` (DPAPI decryption, isBrowserRunning,
browser-skill-commands, cli, terminal-agent) silently no-op on Windows —
the await resolves to `undefined` immediately, the caller reads stdout
before the child has produced anything, and the operation looks like a
silent failure. Most visible symptom: cookie picker's DPAPI helper
reports `DPAPI decryption failed:` with empty stderr.

Adding `proc.exited` exposes the second-order issue: every consumer that
awaits exited *before* reading stdout hits `Response body disturbed or
locked`, because Node's auto-flowing Readable has already drained by the
time the consumer wraps it. `Readable.toWeb()` (Node 18+) hands the
consumer a buffered Web ReadableStream that behaves like Bun's native
API regardless of read order. Falls back to the raw Node Readable on
Node < 18 so the polyfill stays backward-compatible.

The test file's existing `require('${polyfillPath}')` interpolation
escaped its backslashes on Windows, so the tests had been silently
unrunnable there; a `.replace(/\/g, '/')` on the resolved path fixes
the interpolation and lets the new regressions run on the
windows-free-tests matrix.

Test plan
- bun test browse/test/bun-polyfill.test.ts — 7 pass (3 new + 4 existing)
- bun test browse/test/cookie-import-browser.test.ts — 22 pass
- bun test (full suite) — passes; the unrelated batch.test.ts
  beforeEach-timeout flake is the only fail and is present on main.

Related: #764 (Windows cookie import), PR #392 (open WIP for full DPAPI
+ v20 fallback support — this PR is strictly scoped to the polyfill so
it can land independently of that broader effort).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 00:22:56 -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(bun-polyfill): Bun.spawn parity for proc.exited and stream consumption 2026-05-27 00:22:56 -07:00
test fix(bun-polyfill): Bun.spawn parity for proc.exited and stream consumption 2026-05-27 00:22:56 -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.47.0.0 feat: /spec — author backlog-ready spec in 5 phases + optional agent spawn (#1698) (#1733) 2026-05-26 21:36:53 -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