Repository navigation
Description
Summary
An agent that builds a plugin in its thread storage folder ($BB_THREAD_STORAGE, <dataDir>/thread-storage/<threadId>) and installs it with bb plugin install . --yes loses the plugin's source when the thread is deleted. bb registers the plugin by that folder path. Deleting the thread runs thread.storage.delete, which removes the folder. Storage Retention auto-deletes archived threads, so this can happen without the user doing anything. Nothing warns at install or delete time, not even the server-log line that #1566 added for workspaces.
Expected: a plugin installed from thread storage keeps working after that storage goes away.
Versions and environment
bb from source at main cb262faa72 (pnpm start:worktree, server version 0.48.1), macOS 26.5 (Darwin 25.5.0), Node 22.23.1. Source CLI run with BB_CLI and BB_SERVER_URL unset. Provider: claude-code (only used to create the thread).
Steps to reproduce
bb thread spawn --project proj_personal --provider claude-code --title "Plugin storage repro" --prompt "Reply only with ok.". The thread's storage folder<dataDir>/thread-storage/<threadId>now exists.- In
<dataDir>/thread-storage/<threadId>/bb-plugin-storagedemo, write a server-only plugin:package.json:{"name":"bb-plugin-storagedemo","version":"0.1.0","type":"module","engines":{"bb":">=0.0","bbPluginSdk":">=0.4.3"},"bb":{"name":"Storage demo","description":"Built in thread storage.","branding":{"icon":"Zap"},"server":"./server.ts"}}server.ts:export default async function plugin(bb) { bb.settings.define({ greeting: { type: "string", label: "Greeting", description: "Demo setting." } }); }
- From that folder:
bb plugin install . --yes, thenbb plugin config storagedemo set greeting hello-from-storage. bb thread delete <threadId> --yesbb plugin reload storagedemo, thenbb plugin list. Restarting bb shows the plugin as missing.
Expected vs actual
Actual (step 3, no warning in CLI output or server log):
[email protected] running
source: path:<dataDir>/thread-storage/thr_45jajad99g/bb-plugin-storagedemo
Actual (step 5, the folder is gone):
plugin "storagedemo" reload failed: plugin directory not found: <dataDir>/thread-storage/thr_45jajad99g/bb-plugin-storagedemo (reinstall) (the previous instance is still running)
Expected: the plugin keeps loading after the thread is deleted, from a copy bb keeps, with its settings intact.
Evidence
- Delete path:
requestThreadStorageDeletionsendsthread.storage.delete. The daemon'sdeleteThreadStoragerunsrm -rfon the folder. Every thread delete goes through this: the thread delete route, project deletion, the lifecycle sweep, and Storage Retention'sthreads.delete. - Install path:
installPathSourceregisterspath:<rootDir>. Its warning usesisBbManagedWorkspacePath, which coversworktrees/,personal-workspaces/and plugin workspace folders but notthread-storage/.grep -c "bb-managed workspace" <dataDir>/logs/server.1.logreturned 0 after the install. - Repro thread on the dev instance:
thr_45jajad99g.
What you ruled out
- Not a duplicate of Plugins built in a thread are tied to the thread's workspace and deleted silently when it's archived #6670: that issue is the same loss for thread workspaces (Personal workspace / worktree folders), which do get the server-log warning. Thread storage gets no signal at all.
- Not Env destroy deletes registered path-sourced plugins (no plugin-source guard before rm -rf) #1565: closed by fix(plugins): warn when installing a path plugin from a managed workspace #1566, which only added that log warning for workspace paths.
- Archiving alone did not delete storage in this repro. Deletion (manual or Storage Retention) does.
Suggested priority and effort (optional)
High: the plugin's source code is lost, and agents use thread storage as their scratch space. Effort: medium.
AGENT GENERATED. Investigation thread: thr_d5g2kma75k
Activity
bb-slop-cop commentedon Nov 4, 2026
🚨 SLOP COP 🚨 ·
new-issue-autopilotthreadsandplugins; addedconfirmed-repro.ea980cbbba(missingafter service restart instead ofrunning); settings remain intact. All 39 existing plugin-service tests pass. This is a service-level reproduction, not a live CLI/retention run.Keep plugins installed from a thread's storage when the thread is del…
Keep path plugins when bb deletes their thread storage or workspace, …