gstack/browse
Salim Habash 1d77c85b07 fix(bun-polyfill): drain spawned pipes eagerly to handle large output
Codex review on the prior commit flagged the pull-based Readable.toWeb
approach: when the child writes more than the OS pipe buffer (~16-64 KB
depending on platform) and the consumer awaits proc.exited before
reading stdout, the buffer fills, the child blocks in write(), and exit
never fires. browser-skill-commands.ts hits exactly this pattern when
a spawned skill produces non-trivial output.

Replace toWeb with eager-drain-then-replay: stdout and stderr are read
into in-memory chunk arrays via 'data' events the moment the child
starts, so pipes never back-pressure. proc.exited now resolves only
after both exit and the drain have completed, so consumers reading
stdout AFTER awaiting exit always see the full output. Consumers
reading BEFORE awaiting exit still get the full output too — the
replayed ReadableStream's start() awaits the drain before enqueueing.

Adds a regression test that writes 1 MB to stdout — pre-fix this hangs
forever, post-fix it returns in <500 ms. Removes the now-unused
stream.Readable require.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 00:37:28 -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): drain spawned pipes eagerly to handle large output 2026-05-27 00:37:28 -07:00
test fix(bun-polyfill): drain spawned pipes eagerly to handle large output 2026-05-27 00:37:28 -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