Repository navigation
Keep plugin-panel browser tabs out of daemon snapshots - #3451
Merged
Merged
Conversation
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
force-pushed
the
akc/skip-plugin-panel-browser-snapshots
branch
from
September 11, 2026 00:02
b7eb784 to
3dca425
Compare
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.
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 asplugin-panel:cloud-sandbox:cloud-machines:pane-1. The desktop browser broker published adesktop-browser.changedsnapshot 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 (isRawThreadIdfrom@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 optionalthreadId, which still defaults to"thread-1"for every other test.HOST_DAEMON_PROTOCOL_VERSIONis unchanged.How you verified
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/desktoppasses.🤖 Generated with Claude Code