Repository navigation
Description
Summary
While any plugin's async content-script mount promise is pending, the foreign-DOM-mutation guard treats every DOM insert on the page as made by that plugin, including bb's own React commits. On every page load React's insert of bb's plugin overlay container (<div data-bb-plugin-app-overlays>) into #root is refused, so no plugin's experimental_appOverlay content reaches the page. A plugin whose mount only waits on a timer and touches no DOM is enough to trigger it. Expected: the guard refuses only moves made by plugin code, and the overlay container mounts.
Versions and environment
- Server: bb-app 0.46.2-nightly.39288295552.1 (npm global prefix, systemd user service), Ubuntu, Node 24
- Clients: headless Chromium (Playwright chromium-1243) on the server host, and the Windows desktop app "bb Nightly" 0.46.2 (Windows 11). Both show it.
- Code cited below is unchanged on
mainatb0bb68655adcc6cd79e495d3484f4011a0640e2e. Not checked on 0.46.1.
Steps to reproduce
-
Create a plugin in
/tmp/slow-mount-repro:package.json{ "name": "bb-plugin-slow-mount-repro", "version": "0.0.1", "type": "module", "engines": { "bb": ">=0.43", "bbPluginSdk": ">=0.5.9" }, "bb": { "name": "Slow mount repro", "description": "Async content-script mount that waits 5 s and touches no DOM.", "branding": { "icon": "./assets/icon.svg" }, "server": "./server.ts", "app": "./app.tsx", "skills": [] } }app.tsximport { definePluginApp } from "@get-bb/plugin-sdk/app"; export default definePluginApp((app) => { app.contentScripts.register({ id: "slow-mount", // Touches no DOM; only keeps the mount promise pending for 5 s. mount: () => new Promise<void>((resolve) => setTimeout(resolve, 5000)), }); });
server.tsimport type { BbPluginApi } from "@get-bb/plugin-sdk"; export default function plugin(_bb: BbPluginApi) {}
plus any
assets/icon.svg. -
bb plugin install /tmp/slow-mount-repro --yes -
Load the app in a fresh browser profile and, after it settles, run in the console:
document.querySelector('[data-bb-plugin-app-overlays]') -
bb plugin remove slow-mount-repro --yesand repeat step 3.
Expected vs actual
With the plugin installed (2 of 2 loads):
[bb] plugin "slow-mount-repro" tried to move <div> out of React's tree. The move was blocked so the app does not crash when that node is later removed or reordered.
document.querySelector('[data-bb-plugin-app-overlays]') -> null
Plugin removed (1 of 1 load): no warning; the query returns the element.
Expected: no warning, since the plugin never touches the DOM, and the overlay container is mounted.
The warning's stack is React's commit, not plugin code (captured over CDP):
recordRefusedMove index-C4VnRLIO.js 397:18294
refusePluginReparent index-C4VnRLIO.js 397:18591
guarded insertBefore index-C4VnRLIO.js 397:20429
(react-dom commit) boot-vendor-CF34wNtG.js 7:93783, 7:104851, 7:102265, …
node: <div data-bb-plugin-app-overlays class="contents"> (children: plugin roots for auto-answer, beautiful-chat, …)
attemptedParent: <div id="root">
actualParent: null
Evidence
Observed: the refusal and the missing container, above.
Cause (my reading of the code, not a confirmed fix):
runWithPluginDomIsolationAsyncincrements the globalisolationDepthand decrements it only after the mount promise settles. Everything that runs on the main thread in between, including React commits, seesisolationDepth > 0.refusePluginReparentthen refuses inserting a fresh React-owned node (parentNode === null) into a parent that has no React fiber.#rootis the React root container, so it has none. Portal containers that bb creates outside React would match the same way.- Content-script mounts go through it in
plugin-frontend.ts. Async mounts are documented as allowed and are time-boxed to 10 s, so the window can be up to 10 s per plugin.
Real-world trigger: agentic-mermaid awaited fetching bb's chunks and importing Mermaid inside mount, which hit this on every load. Plugin-side workaround: bottlebrushes/bb-plugin-agentic-mermaid#2. Every plugin with a non-trivial async mount is exposed.
Measured with headless Chromium driven over CDP: fresh profile, Page.navigate, then the query above about 28 s later. Load-to-mount took about 23 s on this host.
Possible direction: keep isolation only around synchronous plugin execution, which callback and timer wrapping already cover, instead of across the awaited promise.
What you ruled out
- Not plugin DOM code: the repro plugin touches no DOM, and the stack is react-dom's commit.
- Not Plugin overlays render under the native Browser tab view; plugins cannot use the browser-dimming hook #3812 (overlays rendered under the native Browser view): here the overlay container is not in the document at all.
- Removing the slow-mount plugin, or making its mount return synchronously, makes the warning go away and the container mounts.
Suggested priority and effort
Medium. It silently hides every plugin's app overlays whenever any installed plugin has a slow async mount, and users cannot see why. Plugin authors can work around it. Effort probably Low.
I could not link a bb thread: this came from a local agent debugging session on a self-hosted server.
AGENT GENERATED
Activity
bb-slop-cop commentedon Oct 20, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotplugins.confirmed-repro.awaitprotection. Correct execution ownership needs a design decision, outside the simple-fix gate.Let React commit into its containers while a plugin mount is pending (g…