Skip to content

Claude Code: bb-bridge deferred tools vanish after compact/reconnect until process rebuild #3625

Closed as not planned

Description

@uje-m

Summary

On a long-lived Claude Code root thread, BB-injected mcp__bb-bridge__* tools (UltraGoal plan tools, collab tools, even omega_operator_ack_v1) disappeared from Claude's deferred tool catalog after a host-daemon reconnect plus /compact. ToolSearch returned No matching deferred tools found with no error for ~28 hours. The same Claude session id recovered them only after bb.service reconstructed the provider process. A stranger should treat this as: plugin tools can silently vanish from a live Claude session and stay gone until process rebuild.

Versions and environment

  • bb 0.43.1 deployed from source at local port tip f3fae1db1 (six timeline-worker commits on top of origin/main f3e43c40a81ffa5afebf130e64070879d29f813b). The cited Claude-bridge and host-daemon paths are unchanged by those local commits.
  • Install: systemd user bb.service, Linux, Node from the bb-app tree.
  • Provider: claude-code, Claude Code 2.1.268.
  • Unusual: long-lived busy root (never idle-reaped for ~29h), UltraGoal 0.28.0, host-daemon reconnect during load, operator /compact.
  • Could not re-run a clean trusted-checkout synthetic repro in this filing; production evidence is below. Mark the causal fork unverified.

Steps to reproduce

Observed production sequence (WIB). This is the closest faithful repro; a clean compact-after-MCP-attach fixture is the required next proof, not a claim that this already exists.

  1. Run a busy Claude Code root with plugin tools attached (mcp__bb-bridge__ultragoal_* callable).
  2. Confirm tools work (here: last success mcp__bb-bridge__ultragoal_patch at 2026-09-13 07:15:16).
  3. Host-daemon disconnect/reconnect (here: WS 1006 then 1000 at 07:48:07–07:48:11; provider-claude-code worker recycled; server re-listen 07:48:10).
  4. In the same Claude session, /compact (here: compact_boundary 07:53:37, session continued from a previous conversation that ran out of context).
  5. From the agent, ToolSearch for ultragoal, select:mcp__bb-bridge__ultragoal_patch, and select:mcp__bb-bridge__omega_operator_ack_v1.
  6. Keep sending turns for hours without idle-reaping the provider session.
  7. Reconstruct the provider process (here: owner-authorized bb.service restart 2026-09-14 11:42:55) and ToolSearch again.

Did not reproduce as a configure-time skip: tools worked for ~40 minutes after an earlier 06:34 process start on the same plugin SHA. Did not require a plugin version change.

Expected vs actual

Expected: After compact/reconnect, mcp__bb-bridge__* remain in Claude's deferred catalog (ToolSearchable) without a full provider-process rebuild. A root can tell "bridge attached" from "tool never registered."

Actual (verbatim ToolSearch results from the Claude jsonl):

Before rebuild, every search 2026-09-13 07:54:46 through 2026-09-14 11:31:17:

No matching deferred tools found. Note: these configured MCP servers failed to connect, so their tools are unavailable for this session: paper (ConnectionRefused): "Unable to connect. Is the computer able to access the url?"

The paper note is a different MCP server and was present on both failing and succeeding searches.

After bb.service restart, 2026-09-14 11:44:23:

[{"type": "tool_reference", "tool_name": "mcp__bb-bridge__ultragoal_state"}, {"type": "tool_reference", "tool_name": "mcp__bb-bridge__ultragoal_patch"}, {"type": "tool_reference", "tool_name": "mcp__bb-bridge__ultragoal_release_slice"}, {"type": "tool_reference", "tool_name": "mcp__bb-bridge__resolve_finding"}]

Zero mcp__bb-bridge__* / ultragoal_* tool_use between compact and restart. First success after rebuild: ultragoal_state at 11:44:25. Same Claude session id abd8455f-d01b-4e58-8ad8-968bd3fa50c5.

Evidence

  • Thread thr_ud7k5xhiud, provider claude-code, environment env_2j2yd334px, cwd /home/uje/codes/omegacode-wt/integration.
  • Claude jsonl: /home/uje/.claude/projects/-home-uje-codes-omegacode-wt-integration/abd8455f-d01b-4e58-8ad8-968bd3fa50c5.jsonl (session abd8455f, 2026-09-11 20:28 → 2026-09-14 13:38 WIB). compact_boundary at L11538; last pre-compact bb-bridge tool_use L11413; first post-restart tool_use L24239.
  • Restart receipts: /home/uje/jobs-op/tmp/ug/bb-restart/pre-restart.txt, post-restart.txt (MainPID 3221292 → 1798277, issued 11:42:55+07:00, verified 11:44:04).
  • Logs: ~/.bb/logs/server-stdio.log (Server listening 07:48:10; ultragoal loaded 07:48:34), ~/.bb/logs/host-daemon-stdio.log (disconnect 07:48:07, provider-claude-code worker stopped 07:48:11 / ready 07:49:10). No idle reap of this Claude session between 2026-09-13 06:34 and 2026-09-14 11:42.
  • Observed (BB amplifier, not yet the exclusive cause): later turns of a live runtime do not re-attach dynamicTools. resumeThreadRuntimeIfMissing returns if the thread already exists; runSubmittedTurn omits dynamicTools. Claude attachThreadSession builds the bb-bridge MCP server only when params.dynamicTools.length > 0. Permalinks on origin/main f3e43c40a81ffa5afebf130e64070879d29f813b:
    • async function resumeThreadRuntimeIfMissing(
      args: ResumeThreadRuntimeIfMissingArgs,
      ): Promise<void> {
      const { command, entry, options } = args;
      const { resumeContext } = command;
      if (entry.runtime.hasThread(command.threadId)) {
      return;
      }
      if (!resumeContext.providerThreadId) {
      throw new CommandDispatchError(
      "unknown_thread_runtime",
      `No provider thread id available for thread ${command.threadId}`,
      );
      }
      const bridgeLaunch = await resolveRuntimeBridgeLaunch(
      command.resumeContext.bridgeLaunch ?? command.bridgeLaunch,
      options,
      );
      await entry.runtime.resumeThread({
      bridgeLaunch,
      environmentId: command.environmentId,
      threadId: command.threadId,
      projectId: resumeContext.projectId,
      providerThreadId: resumeContext.providerThreadId,
      providerId: resumeContext.providerId,
      contributedEnv: resumeContext.contributedEnv,
      options: command.options,
      instructions: resumeContext.instructions,
      dynamicTools: resumeContext.dynamicTools,
    • async function runSubmittedTurn(
      command: TurnSubmitCommand,
      entry: RuntimeEntry,
      ): Promise<HostDaemonCommandResult<"turn.submit">> {
      await entry.runtime.runTurn({
      threadId: command.threadId,
      input: command.input,
      clientRequestId: command.requestId,
      options: command.options,
      contributedEnv: command.resumeContext.contributedEnv,
      instructions: command.resumeContext.instructions,
      });
      return { appliedAs: "new-turn" };
      }
    • function attachThreadSession(
      id: string | number,
      params: SessionConstructionParams,
      providerThreadId: string,
      resume: boolean,
      ): void {
      const threadIdRef = { current: params.threadId };
      const env = buildSessionEnv(readConfigEnvOverrides(params.config));
      const sessionOptions = buildTrackedSessionOptions(params, env, threadIdRef);
      if (!resume) {
      sessionOptions.sessionId = providerThreadId;
      }
      sessionOptions.canUseTool = createCanUseTool(threadIdRef);
      if (params.dynamicTools && params.dynamicTools.length > 0) {
      const mcpServer = buildBridgeMcpServer(
      params.dynamicTools,
      createForwardToolCall(() => threadIdRef.current),
      );
      sessionOptions.mcpServers = { [BB_BRIDGE_MCP_SERVER_NAME]: mcpServer };
      sessionOptions.allowedTools = getAllowedToolNames(params.dynamicTools);
  • Investigation threads: thr_mwccbuaewx (UltraGoal maintainer request), thr_ud7k5xhiud (Omega corroboration), thr_wqwcxv7i9f (BB-side diagnosis).

What you ruled out

  • Not a duplicate of #2384: that issue is configure false→true on release/resume of a stopped thread. This is tools that were attached, then vanished on a live busy session after compact/reconnect, recovered only by process rebuild. They share the construction-time dynamicTools snapshot; they are not the same symptom. Cross-link only.
  • Not #3185: that is fork-after-compact immediately re-compacting.
  • Configure-skip is unproven and retracted. Production log line would be [plugin:ultragoal] agent configure failed: from invokeWrapped. Zero hits in server-stdio.log and recent server.*.log rotations for this plugin. An earlier plugin-service skip hypothesis was withdrawn by the UltraGoal maintainer after the jsonl evidence. The skip continue on configure failure still exists in code (
    const outcome = await invokeWrapped(pluginId, "agent configure", () =>
    normalizePluginAgentConfiguration({
    knownSkillIds,
    knownToolIds,
    pluginId,
    value: provider({
    ...context,
    pluginMetadata: deepFreezePluginMetadata(
    metadataByPluginId.get(pluginId) ?? {},
    ),
    }),
    }),
    );
    if (!outcome.ok) {
    selectedSkillIdsByPlugin.set(pluginId, new Set());
    continue;
    }
    const selectedTools = new Set(outcome.value.toolIds);
    ) but did not fire here.
  • Not side-chat tool exclusion: thread parentThreadId / originKind are null; the missing window had no ultragoal_* names at all (including collab spawn/list), which is not the worker subset.
  • Not Claude tool-proxy-mcp pagination: it still returns all supplied dynamicTools.
  • Not UltraGoal 0.28.0 change: same git SHA 93191277 before and after; tools worked after the 06:34 start on that SHA.
  • The paper MCP ConnectionRefused footnote is not the miss (present on the successful 11:44 ToolSearch too).
  • Timeline-worker local commits are unrelated to this Claude MCP path.

Suggested priority and effort (optional)

High for long-lived Claude Code + plugin-tool roots: silent loss, no in-session detection, workaround is process rebuild. Causal fork still open, so do not treat this as implementation-approved.

Required next proof (not done)

Keep these two forks separate until one is closed with a fixture:

  1. Omitted at attach: after daemon reconnect, BB thread/resume / attachThreadSession ran with empty or plugin-less dynamicTools.
  2. Claude index loss: MCP was attached, then /compact dropped mcp__bb-bridge__* from the deferred catalog.

Required observability: capture dynamicTools names on the resume/attach around compact, and Claude system/init / ToolSearch catalog before vs after compact_boundary, without requiring a full bb.service restart. A compact-after-MCP-attach Claude fixture that asserts mcp__bb-bridge__* remain ToolSearchable is the reproduction this issue still needs.

No code change is authorized from this filing.

AGENT GENERATED

Activity

  1. added theissue type on Sep 14, 2026
  2. added
    providers
    provider-claude-code
    no-repro
    on Sep 14, 2026
  3. bb-slop-cop commented on Sep 14, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Bug · High priority · Medium effort; labels: providers, provider-claude-code, no-repro. Final Type verified as Bug.

    Reproduction report: NOT REPRODUCED, root-cause confidence low. A controlled bridge/MCP probe passed in two clean checkouts of trusted main: tool listing survived a simulated compact event and unchanged session resume. This did not exercise live Claude ToolSearch or a daemon disconnect.

    Root cause remains unresolved: construction-time tool attachment is confirmed, but neither empty attachment input during the incident nor Claude catalog loss is established. No PR: the reported failure lacks a faithful failing regression test.

    AGENT GENERATED

  4. SawyerHood commented on Sep 14, 2026

    @SawyerHood
    Collaborator

    Consolidated into #3626 at the owner’s request. The canonical tracker now preserves this report’s additional evidence and acceptance requirements. Closing as duplicate/covered scope, not as fixed.

    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

    no-reproprovider-claude-codeproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions