Skip to content

claude-code provider: resident session keeps a missing/stale bb-bridge after plugin reload; dynamicTools never refreshed on later turns #5843

Open

Description

@mikekonoval

Summary

With the claude-code provider, a resident session can come up without the bb-bridge MCP server (all plugin agent tools and update_environment_directory missing) and never get it back on later turns. Only bb thread stop <id> followed by a new turn restores it.

What happened (bb-app 0.46.1, macOS, Claude Code 2.1.304)

  1. A thread was idle; a queued --send-at message woke it.
  2. In the same seconds a third-party plugin that contributes agent tools was reinstalled from a new local path (bb plugin install path:<new> --yes; server log: plugin <id> source moved from path:... to path:...).
  3. The turn started a fresh resident session (turn id prefix changed). Claude Code transcript shows at that moment all MCP servers removed and, 6 s later, all re-added except bb-bridge (deferred_tools_delta removedNames include mcp__bb-bridge__*, the following addedNames don't).
  4. The next turns on the same thread (10 and 30 min later) still had no bb-bridge: ToolSearch select:mcp__bb-bridge__task_submit → no match. The plugin itself was running; other threads had the tools.
  5. bb thread stop <id> + new message → tools are back. Also works from inside the thread: queue bb thread tell $BB_THREAD_ID --send-at <+1m> ..., then bb thread stop --self.

Likely cause

In provider-claude-code/dist/host.js, attachThreadSession builds mcpServers = { "bb-bridge": ... } only when dynamicTools.length > 0 at attach time, presumably empty while the plugin was reloading. startTurn updates env/chrome/1M-context settings on the resident session but never compares dynamicTools, so a session attached with an empty or stale tool set keeps it until the runtime is released.

Expected

On each turn, if the thread's dynamic tool set differs from the one the resident session was built with, refresh bb-bridge (setMcpServers) or set restartBeforeNextTurn, the same way it's done for execution-setting changes. Tool-set changes from plugin install/reload/update would then reach live sessions.

Activity

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

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority Medium · Effort Medium.
    • Labels: providers, host, provider-claude-code, partial-repro.
    • Report: Reproduction and root cause.
    • Verdict: PARTIALLY REPRODUCED; high confidence in the verified resident tool-update defect.
    • Root cause: The daemon skips resumption for resident threads and does not forward fresh dynamicTools to the runtime. Claude already compares tool snapshots and rebuilds on explicit resume.
    • Evidence: Two clean trusted-main checkouts give the same results: two expected resident-update test failures, two passing release controls, and two passing Claude lifecycle probes. The live plugin-reload race remains unverified.
    • Pull request: Not opened: a safe refresh requires coordinated daemon/runtime lifecycle changes, beyond the single-subsystem simple-fix limit.

    AGENT GENERATED

  4. SawyerHood commented on Oct 20, 2026

    @SawyerHood
    Collaborator

    Cross-linked the verified resident-refresh evidence into #3626, the older Claude catalog-loss tracker, to coordinate implementation rather than create competing refresh fixes.

    These are not confirmed exact duplicates: #3626 starts with reconnect/compaction and has an unresolved initial-loss mechanism; this report starts with reload/session attachment. #5479 reports a stale schema even after stop/resume (unlike this report's working stop workaround), and #5359 covers ACP live updates without rebuilding. Keep those separate acceptance cases. This issue remains open; no fix is claimed.

    AGENT GENERATED

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

    hostpartial-reproprovider-claude-codeproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions