Skip to content

fix: pass extraEnv to Windows server launcher#719

Open
jeffrichley wants to merge 1 commit intogarrytan:mainfrom
jeffrichley:fix/windows-extraenv-passthrough
Open

fix: pass extraEnv to Windows server launcher#719
jeffrichley wants to merge 1 commit intogarrytan:mainfrom
jeffrichley:fix/windows-extraenv-passthrough

Conversation

@jeffrichley
Copy link
Copy Markdown

Summary

  • Windows startServer() was silently dropping extraEnv (containing BROWSE_HEADED, BROWSE_PORT, BROWSE_SIDEBAR_CHAT), causing /connect-chrome to always launch headless on Windows
  • The Node launcher code only forwarded BROWSE_STATE_FILE to the spawned process; the extraEnv parameter was ignored
  • Now all extra env vars are serialized into the launcher code string and merged via Object.assign

Root cause

cli.ts:235-239 — the Windows code path builds a one-liner JS string to spawn the server via node -e. The env object in that string only included BROWSE_STATE_FILE, not the extraEnv parameter passed by callers like the connect command.

The macOS/Linux path (line 243) correctly passes ...extraEnv via Bun.spawn().

Test plan

  • Tested on Windows 11 — /connect-chrome now opens a visible headed Chromium window
  • Verify macOS/Linux path is unchanged (no code touched)
  • Verify other extraEnv consumers work (e.g. BROWSE_PORT forwarding)

🤖 Generated with Claude Code

The Windows code path in startServer() used Node's child_process.spawn
with detached:true for process independence, but only forwarded
BROWSE_STATE_FILE to the spawned process. The extraEnv parameter
(containing BROWSE_HEADED, BROWSE_PORT, BROWSE_SIDEBAR_CHAT) was
silently dropped, causing /connect-chrome to always launch headless
on Windows.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant