Skip to content

Claude provider: resumed thread keeps stale plugin tool schema after plugin reload and bb thread stop #5479

Open

Description

@lawrenceluk

Problem

After a plugin's tool contract changes and the plugin is reloaded, an existing Claude thread keeps exposing the old tool definition (description and input schema), even after bb thread stop and a new turn. A fresh exact-name ToolSearch on the resumed thread also returns the old definition. The new fields can't be used from that thread.

Environment

BB 0.46.0, macOS, built-in provider-claude-code with its bb-bridge MCP server. Local-path plugin registering tools via bb.agents.registerTool.

Observed

  1. Thread discovers plugin tool T (description "v10", schema S10).
  2. Plugin updated so T is "v11" with schema S11: new optional selection object on one operation, new required assessment object on another. Built, then bb plugin reload → ok/running.
  3. bb plugin list --json shows T as v11.
  4. bb thread stop <thread> --json → ok; thread shows idle.
  5. bb thread tell <thread> '...' --mode auto resumes it. Other MCP servers reconnect.
  6. On the resumed thread, T is still v10 / S10, including after a fresh exact-name ToolSearch.

Expected

After plugin reload plus a supported runtime release, the resumed thread's tool definitions match the current plugin registration. Or, if resume intentionally keeps discovered schemas, BB detects the mismatch and offers a supported refresh.

Likely cause

BB passes current registry definitions as dynamicTools to the Claude adapter, which builds bb-bridge tools/list from them. bb thread stop releases the runtime but keeps the provider session identity, so the next turn resumes the old Claude session, and its discovered/deferred tool schemas appear to persist. bb thread clear starts a new provider session and is the only workaround we found, at the cost of model context.

Observed: bb thread clear fixed it — yes. After clearing the same thread, an exact-name ToolSearch returned the v11 description and schema.

Repro

  1. Plugin tool schema_probe, description "A", schema {revision: "A"}; start a Claude thread and discover it.
  2. Change to description "B", schema {revision: "B", marker: string}; build and reload the plugin.
  3. Stop the thread, then resume with a normal message.
  4. ToolSearch schema_probe on the resumed thread: returns A (bug). Expected B, which a new thread should return.

Requested

A supported way to refresh tool definitions on an existing thread without clearing its context: automatic refresh when dynamicTools change, or a targeted command. Plus a regression test covering plugin reload → stop/resume → rediscovery.

Activity

  1. added theissue type on Oct 14, 2026
  2. added
    providers
    plugins
    provider-claude-code
    confirmed-repro
    on Oct 14, 2026
  3. bb-slop-cop commented on Oct 20, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification preserved: Bug · Priority Medium · Effort Medium; providers, provider-claude-code, plugins.
    • REPRODUCED, with high confidence at the BB/CLI boundary. Reproduction label: confirmed-repro.
    • Verified reproduction and root-cause report, including executable evidence and a second clean-checkout run at bd93d18896ba.
    • Root cause: Claude CLI 2.1.284 retains the previously discovered schema across identity-preserving resume, despite BB rebuilding the MCP bridge. Fresh exact-name ToolSearch succeeds but leaves the model-facing schema stale. Changing only the executable to CLI 2.1.245 makes the same regression pass in both checkouts.
    • Verification uses the real BB bridge, SDK, CLI, and a deterministic local API; macOS and the complete plugin-reload UI were not exercised.
    • No PR: no safe, context-preserving root-cause fix is established; rebuilding the MCP server already happens and is insufficient.
  4. lanjak commented on Nov 13, 2026

    @lanjak
    Contributor

    Had a look at this on main at 88cf8f644c. The stale schema isn't coming from bb.

    What bb does: on thread/resume it rebuilds bb-bridge from the current dynamicTools (plugins/provider-claude-code/src/bridge/bridge.ts:2420), and tools/list returns the new definitions.

    What the CLI does: the session file keeps a deferred_tools_record attachment with the generation-1 schema, and the resumed conversation uses that instead of the live MCP definition. The report's repro still fails on Claude Code 2.1.318 and 2.1.323 ('Contract generation 1' vs 'Contract generation 2').

    Tried, no effect:

    • systemPrompt.snapshot: false: removes prompt_snapshot, but deferred_tools_record is still written.
    • alwaysLoad: true on the bridge server: the tool is still sent with defer_loading: true.

    I couldn't find an SDK option to refresh recorded tools on resume. That the CLI pins them on purpose is my reading of its compiled code, not documentation.

    So a refresh on the bb side (#5843, #3626, the closed #6479) probably won't fix this case on its own. The options I can see:

    • start a new or forked session when the tool definitions change (loses context)
    • version the tool names when the schema changes
    • ask Anthropic for a supported refresh on resume

    The last one seems cleanest. bb thread clear should work around it until then, though I haven't tested that.

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-repropluginsprovider-claude-codeproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions