Skip to content

Keep plugin-panel browser tabs out of daemon snapshots - #3451

Merged
andrewkchan merged 1 commit into
mainfrom
akc/skip-plugin-panel-browser-snapshots
Sep 11, 2026
Merged

andrewkchan merged 1 commit into
mainfrom
akc/skip-plugin-panel-browser-snapshots

Conversation

@andrewkchan

@andrewkchan andrewkchan commented Sep 10, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

See human comments in get-bb/bb#3450 for more context

What was wrong

Plugin pages reuse the shared browser deck with threadId={panelStateId} (PluginPanelRightPanelHost.tsx). So a native browser tab opened in a plugin page's right panel is scoped to a synthetic id such as plugin-panel:cloud-sandbox:cloud-machines:pane-1. The desktop browser broker published a desktop-browser.changed snapshot for every scope it had seen. These synthetic scopes therefore went through the host daemon to the server, which has no thread to attach them to. #3450 makes the server drop such snapshots instead of closing the daemon session. This PR stops the desktop app sending them in the first place.

What changed

  • apps/desktop/src/desktop-browser-broker.ts: publish() notifies its daemon-bound listeners only when the scope is a real thread id (isRawThreadId from @bb/domain). Plugin-panel browser tabs stay local to the desktop app. The renderer's local control-state IPC is unchanged.
  • apps/desktop/test/desktop-browser-broker-snapshots.test.ts (new): with one real-thread tab and one plugin-panel tab, only the real thread's snapshot is published across window registration, host connect and a tab change.
  • apps/desktop/test/desktop-browser-view-manager.test.ts: the reconnect test checks daemon-bound snapshots, so it now uses real-format thread ids. The fixture helper gained an optional threadId, which still defaults to "thread-1" for every other test.
  • No server/daemon wire change; HOST_DAEMON_PROTOCOL_VERSION is unchanged.

How you verified

  • New test, before the broker change: AssertionError: expected Set{ 'thr_23456789ab', …(1) } to deeply equal Set{ 'thr_23456789ab' }. After the change it passes.
  • pnpm exec turbo run test --filter=@bb/desktop → Test Files 42 passed (42), Tests 318 passed | 1 skipped (319).
  • pnpm exec turbo run typecheck --filter=@bb/desktop passes.

🤖 Generated with Claude Code

AGENT GENERATED

Base automatically changed from akc/drop-unusable-browser-snapshots to main September 11, 2026 00:00
Plugin pages scope their browser deck to a synthetic panel-state id, and
the desktop broker forwarded snapshots for every scope to the host daemon
and server, which cannot map them to a thread. Only notify daemon-bound
listeners for real thread ids so plugin-panel tabs stay local.

Co-Authored-By: Claude Opus 5 <[email protected]>
@andrewkchan
andrewkchan force-pushed the akc/skip-plugin-panel-browser-snapshots branch from b7eb784 to 3dca425 Compare September 11, 2026 00:02
@andrewkchan
andrewkchan merged commit a4f5132 into main Sep 11, 2026
16 checks passed
@andrewkchan
andrewkchan deleted the akc/skip-plugin-panel-browser-snapshots branch September 11, 2026 00:13
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