Repository navigation
Description
Summary
Replacing a local (path-source) plugin destroys all of its persisted settings, silently. The CLI offers no in-place replace for a local source, so the only supported path is bb plugin remove followed by install — and remove deletes the plugin's settings rows, schedules and secrets. Operators who reinstall a local plugin from a new checkout silently return to plugin defaults with no error, no warning and no log line.
We hit this in production use, not in a lab: tuned watchdog thresholds silently reverted to defaults mid-operation and invalidated a verification run. It was caught only because that run happened to read its settings back afterwards.
Mechanism
bb-app/server/dist/start-server.js
Call site, in the plugin-removal path (~311140):
if (removed && row) {
forgetMutableRoot(row.rootDir);
deletePluginSchedules(deps.db, id);
deleteAllPluginSettings(deps.db, id);
await rm11(pluginSecretsDir(deps.dataDir, id), { recursive: true, force: true });Definition (~31757):
function deleteAllPluginSettings(db, pluginId) {
db.delete(pluginSettings).where(eq(pluginSettings.pluginId, pluginId)).run();
}So a remove drops settings, schedules and secrets together.
What we ruled out
We checked the two other explanations before filing, because they imply different bugs:
- Not a reload problem. A same-source reload (
bb plugin reload <id>) preserves settings. Verified by reading effective values before and after: unchanged. - Not key orphaning.
plugin_settingsis keyed by(plugin_id, key)with no source-path column, so a changed path under the same plugin id reads the same rows. Values are not stranded under an old key — they are deleted.
The blast radius is therefore bounded to remove/install replacement, not to every plugin reload.
Why this is worse than it looks
The data loss is invisible at exactly the moment an operator is least likely to check. Reinstalling from a new checkout looks like a deployment, not a reset, so there is no prompt to re-verify configuration. The plugin comes back up healthy, reporting ok, running on defaults the operator did not choose and does not know they are on.
In our case the affected settings governed a watchdog's alerting thresholds. It reverted from a 1-minute floor to a 1-hour floor and from a 3-minute stale window to a 24-hour one, while continuing to report healthy. A monitoring component that silently reverts to defaults is one nobody can trust to be running the configuration they set.
Suggested directions
Any one of these would close it; we have no stake in which:
- An in-place replace for local sources, so remove is not the only route.
- Preserve
plugin_settingsacross a remove/install of the same plugin id (or retain and offer restore). - Failing either, make the loss loud: warn at remove time that settings/schedules/secrets will be destroyed, and require confirmation.
(3) alone would have saved us, and is the smallest.
Environment
bb 0.38, macOS. Local path-source plugin.
Activity
pixexid commentedon Aug 18, 2026
Doc-level corroboration:
bb plugin remove --helpstates only — "Remove an installed plugin (git:/npm: managed files are deleted; local path sources are left alone)" — and no documentation mentions settings, schedules, or secrets in connection with remove. The "left alone" phrasing reads to a user as non-destructive for local-path plugins, while the remove path destroys plugin_settings rows, plugin schedules, and the plugin secrets directory. Found while verifying the filed citations against the bb 0.38.0 bundle and CLI help text.SawyerHood commentedon Aug 18, 2026
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1766.html
updateis a no-op for path rows, so the only route is remove+install; PluginService.remove() unconditionally deletes plugin_settings, plugin schedules and the secrets dir (plugin-service.ts ~L1681-1694) with no log/warning, and CLI help + the local-plugin UI dialog describe remove as non-destructive.bb plugin install --replace/ POST /plugins {replace:true}. Independently make remove honest and loud: update CLI description (apps/cli/src/commands/plugin.ts:18…The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at
16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).Move a local plugin to a new directory without losing its settings
Move a local plugin to a new directory without losing its settings (#…