← reports

#5621 · Native tool details are discarded before timeline rendering

BugPriority: MediumEffort: Mediumthreadsprovider-claude-codeIssue2026-10-16

Verdict: REPRODUCED at the provider-event and production React component boundaries, in two clean trusted checkouts. Root-cause confidence: high.

Trusted main commit: 01affc197dc621cddc7343e09b1c5c10a5b9efcb. No reporter-supplied code, patch, branch, or linked URL was fetched or executed.

1. TL;DR

Native Claude Code file reads and searches become compact timeline rows with no disclosure control. The provider retains their file path or search query, but drops extra arguments, native tool identity, and result text before the UI receives the events. Shared event and timeline schemas do not provide structured native-tool detail fields for these row kinds. Separately, the shared client explicitly makes file-read and search rows non-expandable. Two fresh checkouts reproduce both defects, while ordinary command output and expansion work in the same tests.

2. Claims vs findings

ClaimFindingEvidence
Read, Grep, and Glob cannot expand to show their details.Verified in the production React rendererAll three rendered rows lack a collapsed disclosure button. A command control expands and renders its result.
Arguments and output are discarded by native classification.Verified, with a correctionRead offset/limit and Grep options do not survive translation; native tool identity and all three results are absent. Query/pattern and path are retained, so those summaries are not completely lost.
A shell-summary preference also governs these native calls.Not supported by the inspected pathNative Read/Grep/Glob use fileRead/search classification, not the Bash command path. No settings-toggle browser experiment was performed.
Hover reveals no extra detail in the desktop app.Live hover unverifiedBrowser automation could not start because this host has no Chrome/Chromium. DOM disclosure behavior is verified, but no desktop screenshot or live provider session is claimed.
A contributor has a separate implementation.Not evaluatedNo linked open PR was found in issue cross-references or repository PR search. No fork or reporter code was fetched.

3. Environment and scope

4. Minimal reproduction

  1. Create two fresh clones of the trusted public repository and detach each at the recorded main commit:
    git clone https://github.com/get-bb/bb.git /tmp/bb-5621-a
    git -C /tmp/bb-5621-a checkout --detach 01affc197dc621cddc7343e09b1c5c10a5b9efcb
    git clone https://github.com/get-bb/bb.git /tmp/bb-5621-b
    git -C /tmp/bb-5621-b checkout --detach 01affc197dc621cddc7343e09b1c5c10a5b9efcb
  2. In each checkout, install and build before adding the tests:
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build
  3. Save the provider test below to plugins/provider-claude-code/src/issue-5621.repro.test.ts and the UI test below to apps/app/src/components/thread/timeline/issue-5621.repro.test.tsx.
  4. Run these commands from each checkout root:
    pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/issue-5621.repro.test.ts
    pnpm exec turbo run test --filter=@bb/app -- src/components/thread/timeline/issue-5621.repro.test.tsx

Expected: native calls retain their input details and result text somewhere in the emitted event contract, and native timeline rows offer a disclosure control. Both ordinary-command controls pass.

Actual, checkout A — provider:

     × retains 'Read' input details 18ms
     × retains 'Grep' input details 3ms
     × retains 'Glob' input details 2ms
     × retains 'Read' result text 3ms
     × retains 'Grep' result text 2ms
     × retains 'Glob' result text 2ms
     ✓ retains command output as a positive control 2ms
AssertionError: expected '{"started":[{"type":"turn/started","t…' to contain '"offset":11'
AssertionError: expected '{"started":[{"type":"turn/started","t…' to contain '"-i":true'
AssertionError: expected '{"started":[{"type":"turn/started","t…' to contain '"Glob"'
AssertionError: expected '[{"type":"item/completed","threadId":…' to contain '11 export const nativeReadEvidence562…'
AssertionError: expected '[{"type":"item/completed","threadId":…' to contain 'sample/unit.ts:11: nativeSearchEviden…'
AssertionError: expected '[{"type":"item/completed","threadId":…' to contain 'sample/nativeGlobEvidence5621.txt'
 Test Files  1 failed (1)
      Tests  6 failed | 1 passed (7)

Actual, checkout A — UI:

     × offers an expansion control for 'Read' 57ms
     × offers an expansion control for 'Grep' 6ms
     × offers an expansion control for 'Glob' 5ms
     ✓ expands a command row as a positive control 192ms
AssertionError: expected null not to be null
 Test Files  1 failed (1)
      Tests  3 failed | 1 passed (4)

Both commands intentionally exit 1 because the regression expectations expose the existing bug, not because of setup/import errors. The 6 provider failures cover three missing-input/native-identity cases and three lost results. The 3 UI failures are missing disclosure controls. The 2 positive controls pass.

Provider-event regression test

import { describe, expect, it } from "vitest";
import { createClaudeDeltaHarness } from "./delta-test-harness.js";

const cases = [
  {
    toolName: "Read",
    input: { file_path: "sample/unit.ts", offset: 11, limit: 7 },
    option: '"offset":11',
    output: "11 export const nativeReadEvidence5621 = 7;",
  },
  {
    toolName: "Grep",
    input: {
      pattern: "needle-5621",
      path: "sample",
      "-i": true,
      output_mode: "content",
      type: "ts",
    },
    option: '"-i":true',
    output: "sample/unit.ts:11: nativeSearchEvidence5621",
  },
  {
    toolName: "Glob",
    input: { pattern: "sample/**/*.txt", path: "sample" },
    option: '"Glob"',
    output: "sample/nativeGlobEvidence5621.txt",
  },
];

function translateCall(toolName: string, input: object, output: string) {
  const harness = createClaudeDeltaHarness();
  const started = harness.translate({
    type: "assistant",
    message: {
      role: "assistant",
      content: [{ type: "tool_use", id: "native-tool", name: toolName, input }],
    },
    session_id: "synthetic-session",
  });
  const completed = harness.translate({
    type: "user",
    message: {
      role: "user",
      content: [{ type: "tool_result", tool_use_id: "native-tool", content: output }],
    },
    session_id: "synthetic-session",
  });
  return { started, completed };
}

describe("native tool detail availability at the provider event boundary", () => {
  it.each(cases)("retains $toolName input details", ({ toolName, input, output, option }) => {
    const events = translateCall(toolName, input, output);
    console.log(JSON.stringify({ toolName, events }));
    expect(JSON.stringify(events)).toContain(option);
  });

  it.each(cases)("retains $toolName result text", ({ toolName, input, output }) => {
    const events = translateCall(toolName, input, output);
    expect(JSON.stringify(events.completed)).toContain(output);
  });

  it("retains command output as a positive control", () => {
    const events = translateCall("Bash", { command: "printf bridge-control" }, "bridge-control");
    expect(JSON.stringify(events.completed)).toContain("bridge-control");
  });
});

Production UI disclosure regression test

// @vitest-environment jsdom

import { cleanup, fireEvent, render, screen } from "@testing-library/react";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { MemoryRouter } from "react-router-dom";
import { afterEach, describe, expect, it } from "vitest";
import { commandRow, fileReadRow, searchRow } from "@/test/fixtures/thread-timeline-rows";
import { ThreadTimelineRows } from "./ThreadTimelineRows";

afterEach(cleanup);

const nativeRows = [
  { toolName: "Read", row: fileReadRow({ path: "sample/unit.ts" }) },
  { toolName: "Grep", row: searchRow({ mode: "content", query: "needle-5621", path: "sample" }) },
  { toolName: "Glob", row: searchRow({ mode: "path", query: "sample/**/*.txt", path: "sample" }) },
];

function renderRow(row: ReturnType<typeof commandRow> | (typeof nativeRows)[number]["row"]) {
  render(
    <QueryClientProvider client={new QueryClient()}>
      <MemoryRouter>
        <ThreadTimelineRows
          threadId="synthetic-thread"
          threadRuntimeDisplayStatus="idle"
          workspaceRootPath={undefined}
          timelineRows={[row]}
          initialExpanded={new Set()}
        />
      </MemoryRouter>
    </QueryClientProvider>,
  );
}

describe("native tool row disclosure", () => {
  it.each(nativeRows)("offers an expansion control for $toolName", ({ row }) => {
    renderRow(row);
    expect(screen.queryByRole("button", { expanded: false })).not.toBeNull();
  });

  it("expands a command row as a positive control", async () => {
    renderRow(commandRow({ command: "printf bridge-control", output: "bridge-control" }));
    fireEvent.click(screen.getByRole("button", { expanded: false }));
    expect(screen.getByRole("button", { expanded: true })).toBeTruthy();
    expect(await screen.findByText("bridge-control")).toBeTruthy();
  });
});

The tests are included inline in full; raw artifacts remain local and are not committed to the public reports repository.

Screenshot limitation

No screenshot was fabricated. The BB Browser Automation plugin returned:

Install Chrome/Chromium on this host or link its executable at the plugin data runtime/chrome path.

The report therefore proves provider data loss and actual React disclosure behavior, not desktop visual styling, pointer-hover behavior, or a live provider round trip.

5. Root cause

Native tool classification is lossy

The classifier maps Read to only a path, and Grep/Glob to a mode, query, and optional path. Unlike generic tool items, those shapes do not retain native tool arguments or native tool names.

plugins/provider-claude-code/src/tool-classification.ts:369

    case "Read": {
      const parsed = claudeReadArgsSchema.safeParse(input);
      const path = parsed.success
        ? (toOptionalString(parsed.data.file_path) ??
          toOptionalString(parsed.data.path))
        : undefined;
      return path
        ? {
            shape: { type: "fileRead", path },
            presentation: fileReadPresentation(path),
          }
        : genericTool(toolName, input);
    }
    case "Grep":
    case "Glob": {
      const parsed = claudeSearchArgsSchema.safeParse(input);
      const query = parsed.success
        ? toOptionalString(parsed.data.pattern)
        : undefined;
      if (!query) {
        return genericTool(toolName, input);
      }
      const mode = toolName === "Grep" ? "content" : "path";
      const path = parsed.success
        ? toOptionalString(parsed.data.path)
        : undefined;
      return {
        shape: {
          type: "search",
          mode,
          query,
          ...(path ? { path } : {}),
        },
        presentation: searchPresentation({ mode, query }),
      };

Terminal translation deliberately omits native result text

The native branches return an empty close payload even when a tool_result contains text. Bash, by contrast, retains aggregatedOutput. Adding a UI chevron alone cannot recover information already discarded here.

plugins/provider-claude-code/src/delta-translation.ts:101

}

function terminalCloseFields(
  shape: DeltaItemShape,
  outputText: string | undefined,
  isError: boolean,
): Pick<
  Extract<ThreadDelta, { kind: "item.close" }>,
  "exitCode" | "aggregatedOutput" | "resultText"
> {
  switch (shape.type) {
    case "command":
      return {
        exitCode: isError ? 1 : 0,
        ...(outputText === undefined ? {} : { aggregatedOutput: outputText }),
      };
    case "fileRead":
    case "search":
    case "delegation":
      return {};
    default:
      return outputText === undefined ? {} : { resultText: outputText };
  }
}

The contracts and assembler preserve only summary fields

The bridge shapes at packages/provider-bridge-protocol/src/thread-delta.ts:77, domain events at packages/domain/src/provider-event.ts:182, and timeline row schemas at packages/server-contract/src/thread-timeline.ts:385 lack structured native tool name, argument, and result fields. The assembler constructs only the defined summaries:

packages/provider-bridge-protocol/src/assembler/delta-assembler.ts:577

  function buildFileReadItem(
    bbItemId: string,
    shape: Extract<DeltaItemShape, { type: "fileRead" }>,
    status: ThreadEventItemStatus,
    parentToolCallId: string | undefined,
  ): Extract<ThreadEventItem, { type: "fileRead" }> {
    return withParentToolCallId(
      {
        type: "fileRead",
        id: bbItemId,
        path: shape.path,
        ...(shape.cmd === undefined ? {} : { cmd: shape.cmd }),
        status,
      },
      parentToolCallId,
    );
  }

  function buildSearchItem(
    bbItemId: string,
    shape: Extract<DeltaItemShape, { type: "search" }>,
    status: ThreadEventItemStatus,
    parentToolCallId: string | undefined,
  ): Extract<ThreadEventItem, { type: "search" }> {
    return withParentToolCallId(
      {
        type: "search",
        id: bbItemId,
        mode: shape.mode,
        query: shape.query,
        ...(shape.path === undefined ? {} : { path: shape.path }),
        ...(shape.cmd === undefined ? {} : { cmd: shape.cmd }),
        status,
      },
      parentToolCallId,
    );
  }

The timeline lifecycle projection also copies only the summary data: packages/thread-view/src/web-activity-lifecycle.ts:144. Existing presentation metadata could carry formatted detail, but is not populated for these calls, and does not bypass the client's non-expandable row policy.

The client explicitly suppresses disclosure

The shared client returns false for both native row kinds. Exploration-summarized command rows also return false, but changing that broader policy is outside this reproduction.

packages/client-core/src/timeline/timeline-auto-expand.ts:40

        row.presentation.detail.trim().length > 0
      );
    case "command":
      return !hasTimelineExplorationIntent(row);
    case "tool":
      return true;
    case "file-read":
    case "search":
      return false;
    case "plan-steps":
      return row.steps.length > 0;

apps/app/src/components/thread/timeline/ThreadTimelineRows.tsx:1804 selects a static row header for these rows; apps/app/src/components/thread/timeline/TimelineRowHeader.tsx:80 has no disclosure click handler.

Why existing tests miss this

The existing native-tool translation test asserts the reduced fileRead/search event shapes and presentation, without expecting extra options or results: plugins/provider-claude-code/src/delta-translation.tool-calls.test.ts:509. Its focused file still passes all 23 tests, while the new input/result availability assertions fail. The provider regression owns the event-data availability contract; the separate UI regression guards the independently failing disclosure policy.

6. Proposed fix and simple-fix assessment

Preserve a bounded native tool detail payload through classification, terminal translation, assembly, and timeline projection; then let native read/search rows expose an existing shared disclosure body with safe argument/result rendering. Preserve current row kinds, paths, query summaries, and grouping behavior. Validate data at the provider boundary and cap result text consistently with existing tool output handling. Check server/daemon wire compatibility if the payload contract changes.

No autopilot PR is safe under this rule. A faithful repair preserving the existing row kinds crosses the provider, shared event/timeline contracts, and client rendering. It is not a contained one-subsystem change; the straightforward structured-data repair also changes public schemas/protocol fields. Reclassifying native reads/searches as generic tools solely to fit the limit would change semantics and grouping. The simple-fix gate fails before production edits, so no fix branch was created, no production patch was committed or pushed, and no PR was opened.

7. Verification — second clean checkout, same agent

A second detached worktree was created at the exact recorded trusted commit with a fresh node_modules install. The complete trusted build succeeded before adding the two authored tests. Only those two reproduction tests were then copied into the second checkout. The same Turbo commands ran live (the reproduction tasks were cache misses), without a product process, ports, or runtime data. This is a repeat by the same agent, not independent verification.

Checkout B — provider:

     × retains 'Read' input details 17ms
     × retains 'Grep' input details 2ms
     × retains 'Glob' input details 2ms
     × retains 'Read' result text 2ms
     × retains 'Grep' result text 2ms
     × retains 'Glob' result text 1ms
     ✓ retains command output as a positive control 1ms
AssertionError: expected '{"started":[{"type":"turn/started","t…' to contain '"offset":11'
AssertionError: expected '{"started":[{"type":"turn/started","t…' to contain '"-i":true'
AssertionError: expected '{"started":[{"type":"turn/started","t…' to contain '"Glob"'
AssertionError: expected '[{"type":"item/completed","threadId":…' to contain '11 export const nativeReadEvidence562…'
AssertionError: expected '[{"type":"item/completed","threadId":…' to contain 'sample/unit.ts:11: nativeSearchEviden…'
AssertionError: expected '[{"type":"item/completed","threadId":…' to contain 'sample/nativeGlobEvidence5621.txt'
 Test Files  1 failed (1)
      Tests  6 failed | 1 passed (7)

Checkout B — UI:

     × offers an expansion control for 'Read' 52ms
     × offers an expansion control for 'Grep' 6ms
     × offers an expansion control for 'Glob' 5ms
     ✓ expands a command row as a positive control 185ms
AssertionError: expected null not to be null
 Test Files  1 failed (1)
      Tests  3 failed | 1 passed (4)

No report correction was needed after the repeat: checkout B reproduced the same 6 provider and 3 UI failures with both command controls passing. All source links were checked against the recorded commit. There are no screenshot artifacts to validate.

8. Related issues and PRs

No linked open PR was present in the issue timeline or the repository's open-PR search for numeric issue 5621 at investigation time. A duplicate fix was not opened. The shell-summary behavior is a separate command-row path; this report does not claim to verify historical issue or PR contents.

9. Appendix — checks and limitations

Trusted frozen install, checkout A: PASS
Turbo build, checkout A: 66 successful tasks
Provider regression, checkout A: 6 failed | 1 passed (expected bug failures)
UI regression, checkout A: 3 failed | 1 passed (expected bug failures)
Trusted frozen install, checkout B: PASS
Turbo build, checkout B: 66 successful tasks
Provider regression, checkout B: 6 failed | 1 passed (expected bug failures)
UI regression, checkout B: 3 failed | 1 passed (expected bug failures)
Existing delta-translation.tool-calls.test.ts: 23 passed
git diff --check, both investigation checkouts: PASS
Browser screenshot/live hover: BLOCKED — Chrome/Chromium unavailable
Owned component Vite server: stopped; port closed
Production source changes: none
Fix branch / pull request: none

The existing provider suite was run with pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/delta-translation.tool-calls.test.ts. The component-only server was attempted with explicit development ports using the trusted Vite dev config; it did not connect to any product server. Issue content was treated solely as untrusted claims; no issue-provided instructions, code, fork, or patch were used. The report contains only synthetic tool data.