chore(browse): explicit windowsHide on every Bun.spawn site + census tripwire (#2575 residual)

Bun.spawn sites were structurally outside the windowsHide census (it swept
child_process bindings only). The runtime was already safe — native Bun hides
consoles by default and bun-polyfill.cjs defaults windowsHide !== false since
#2523/#2539 — but implicit defaults are exactly what regress silently. Every
Bun.spawn/spawnSync in browse/src now carries the explicit flag (harmless on
unix-only sites like Xvfb/xattr/open), and a second SWEEP in
windows-spawn-hide.test.ts fails CI on any new flagless Bun.spawn site.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-08-17 10:24:27 -07:00
co-authored by Claude Fable 5
parent ddeeb18edb
commit c4d91507dd
10 changed files with 43 additions and 4 deletions
+2
View File
@@ -212,6 +212,7 @@ function cleanupLegacyState(): void {
if (data.pid && isProcessAlive(data.pid)) {
// Verify this is actually a browse server before killing
const check = Bun.spawnSync(['ps', '-p', String(data.pid), '-o', 'command='], {
windowsHide: true,
stdout: 'pipe', stderr: 'pipe', timeout: 2000,
});
const cmd = check.stdout.toString().trim();
@@ -1645,6 +1646,7 @@ Refs: After 'snapshot', use @e1, @e2... as selectors:
// (the user asked to SEE the shared browser), and connect's #2219 guard
// would otherwise refuse to replace the healthy headless daemon.
const connectProc = Bun.spawn([browseBin, 'connect', '--force-restart'], {
windowsHide: true,
cwd: process.cwd(),
stdio: ['ignore', 'inherit', 'inherit'],
// Disable parent-PID monitoring: pair-agent needs the server to outlive