From 256a72a3780e7b1b2b6a2b6754d7d03b87e7e1ee Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Thu, 2 Apr 2026 19:19:54 -0700 Subject: [PATCH] fix: sidebar agent passes BROWSE_PORT to child claude Ensures the child claude process connects to the existing headed browse server (port 34567) instead of spawning a new headless one. Without this, sidebar chat commands run in an invisible browser. --- browse/src/sidebar-agent.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/browse/src/sidebar-agent.ts b/browse/src/sidebar-agent.ts index c2d314c5..f0d62dcd 100644 --- a/browse/src/sidebar-agent.ts +++ b/browse/src/sidebar-agent.ts @@ -242,6 +242,9 @@ async function askClaude(queueEntry: any): Promise { env: { ...process.env, BROWSE_STATE_FILE: stateFile || '', + // Connect to the existing headed browse server instead of launching a new one. + // Without this, the child claude starts a headless browser on a random port. + BROWSE_PORT: process.env.BROWSE_PORT || '34567', // Pin this agent to its tab — prevents cross-tab interference // when multiple agents run simultaneously BROWSE_TAB: String(tid),