Skip to content

Plugins installed from a thread's storage folder are deleted with the thread #6971

Closed

Description

@ymichael

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

  1. 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.
  2. 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." } }); }
  3. From that folder: bb plugin install . --yes, then bb plugin config storagedemo set greeting hello-from-storage.
  4. bb thread delete <threadId> --yes
  5. bb plugin reload storagedemo, then bb 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: requestThreadStorageDeletion sends thread.storage.delete. The daemon's deleteThreadStorage runs rm -rf on the folder. Every thread delete goes through this: the thread delete route, project deletion, the lifecycle sweep, and Storage Retention's threads.delete.
  • Install path: installPathSource registers path:<rootDir>. Its warning uses isBbManagedWorkspacePath, which covers worktrees/, personal-workspaces/ and plugin workspace folders but not thread-storage/. grep -c "bb-managed workspace" <dataDir>/logs/server.1.log returned 0 after the install.
  • Repro thread on the dev instance: thr_45jajad99g.

What you ruled out

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

  1. added
    threads
    plugins
    on Nov 3, 2026
  2. added theissue type on Nov 4, 2026
  3. added
    confirmed-repro
    on Nov 4, 2026
  4. bb-slop-cop commented on Nov 4, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    AGENT GENERATED

  5. added a commit that references this issue on Nov 4, 2026
    f2ff256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-repropluginsthreads

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions