Repository navigation
Description
Two related defects observed while operating a path-installed plugin from a deployed git worktree, on bb 0.39.0 / plugin SDK 0.4.1, macOS. Both are reproducible and both were measured rather than inferred.
1. The host rebuilds plugin frontend artifacts into the deployed root during load
start-server.js (installed app bundle, ~line 310745) rebuilds dist/app.js and dist/app.css during plugin loading when a source file's mtime exceeds dist/app.js, calling buildPluginApp() directly into the plugin's root (~line 310808).
For a plugin deployed from a git checkout, this modifies tracked, committed artifacts in place. The rebuild embeds absolute paths, so the output differs from the committed bytes:
-// src/provider-marks.ts
+// .bb/worktrees/env_ikf7t4jf3k/bb-collab/src/provider-marks.tsObserved across three deploys. server.js is never rebuilt by this path; only app.*. Timing: server.js at 01:53:08 from the checkout, app.css/app.js at 01:53:21 — about 13 seconds after the reload returned.
Why it matters: we verify the deployed artifact against its commit before loading it, so we know what actually runs. This silently invalidates that check after the load, and the failure surfaces on the next deploy as unexplained drift. It also means a deployed checkout is permanently dirty between deploys, and the integrity check cannot distinguish "someone hand-edited an artifact" from "the host rebuilt it" — which is the distinction it exists to draw.
Workaround we now use: ensure dist/ mtimes are newer than all sources after advancing the checkout, so the gate is unsatisfied. This works, and it depends on an undocumented internal condition.
Ask: don't write into a plugin's root during load — or make the rebuild reproduce the committed bytes (build-location independent) — or expose the condition so a deployer can reason about it.
2. bb plugin reload leaves orphaned services running and still reports exit 0
A reload left the plugin's previous lane-watcher service resident. It survived holding a reference to the now-closed database connection and threw on every tick:
capacity-interval-unreadable:TypeError: The database connection is not open
845 occurrences over the following 16 minutes, roughly one every 5 seconds. Meanwhile:
bb plugin reloadreturned exit 0bb plugin listshowed degraded (service lane-watcher did not stop)- the plugin's CLI command surface was entirely gone —
bb collab …returnederror: unknown command 'collab'
A second reload cleared the degraded label and restored the command surface. bb plugin disable followed by enable fully cleared the orphan.
Ask: a reload that cannot stop a service should fail its own exit code rather than reporting success. An exit code that says "the loader ran" while the plugin is unusable is the wrong signal for an automated deploy, which is exactly where reload is used.
Smaller, related
bb plugin list reported running for a period while a component was still dead. Degraded at least tells the truth; running over a broken component is worse for an operator deciding whether to act.
Happy to help
We can supply logs, exact timings, or test against a patch. The workaround for (1) is in our deploy procedure, so neither is blocking us — but both cost real debugging time, and (2) cost fifteen minutes of unrecorded data before anyone thought to look past the exit code.
Activity
SawyerHood commentedon Aug 20, 2026
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/2029.html
bb plugin reloadexits 1 via the existing !ok path; no daemon wire change. Defect 1: build path-install app/host artifacts into a host-owned cache under the data dir (add an outDir to buildPluginApp/buildPluginHost, serve getAppAsset from it) instead of /dist; at minimum skip the unconditional install-time build when a compatible dist/app.meta.jso…The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at the base commit, and repro artifacts. It was independently re-run by a second agent (see its Verification section).
Report a failed plugin reload instead of exit 0
Report a failed plugin reload instead of exit 0 (get-bb#2155)
Never report a failure as the user's answer to an agent (#7723)