fix(browse): pass windowsHide in bun-polyfill spawn wrappers (Windows console flash every 60s)#2294
Open
rroojrooj wants to merge 1 commit into
Open
fix(browse): pass windowsHide in bun-polyfill spawn wrappers (Windows console flash every 60s)#2294rroojrooj wants to merge 1 commit into
rroojrooj wants to merge 1 commit into
Conversation
…s don't flash console windows On Windows the browse daemon runs under Node via bun-polyfill.cjs (Bun cannot drive Playwright's Chromium there). The polyfill's spawn/spawnSync forward only stdio/env/cwd and drop windowsHide, so every child process gets a visible conhost window. The most user-visible effect: the terminal-agent watchdog respawns 'bun run terminal-agent.ts' every 60s (AGENT_WATCHDOG_TICK_MS), so users see a bun.exe console window flash roughly once a minute per daemon, indefinitely. With two daemons alive that's a flash every ~30 seconds. windowsHide is ignored on non-Windows platforms, so this is a no-op everywhere else. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
windowsHide: trueto thespawn/spawnSyncwrappers inbrowse/src/bun-polyfill.cjs.Why
On Windows the browse daemon runs under Node via
bun-polyfill.cjs(Bun can't drive Playwright's Chromium there — the polyfill's own header cites oven-sh/bun#4253/#9911). The polyfill forwards only{stdio, env, cwd}tochild_processand dropswindowsHide, so every child process the daemon spawns gets a visible conhost window.The most user-visible symptom: the terminal-agent watchdog in
server-node.mjsrespawnsbun run terminal-agent.tsevery 60s (AGENT_WATCHDOG_TICK_MSdefault), so users see abun.execonsole window flash roughly once a minute per daemon, indefinitely. I measured two daemons alive concurrently on my machine → a flash every ~30 seconds, all day.Because the polyfill is the single choke-point every
Bun.spawn/Bun.spawnSynccall goes through on Windows, fixing it here covers all spawn sites at once (tasklistliveness probes, PowerShell helpers, the terminal-agent, etc.).windowsHideis ignored by Node on non-Windows platforms, so this is a no-op everywhere else.Note: patching the call sites instead would not work — the options never reach
child_processunless the polyfill forwards them.Testing
node --checkpasses.There's a companion issue with full measurements of the watchdog respawn/leak behavior this change makes invisible but does not fix — the leak itself deserves its own fix.
🤖 Generated with Claude Code