Reports

#7596 · Claude session metadata becomes diagnostic events

BugPriority: LowEffort: Lowprovidersprovider-claude-codeGitHub issue

2026-11-15 · trusted main da3e60b81d560e114a2bec724bb59c997aaaae7f

Verdict: REPRODUCED at the SDK-envelope → timeline-event boundary. Root-cause confidence: high. Reproduction label: confirmed-repro.

1. TL;DR

Two informational Claude system-message families are missing from the provider's explicit visibility classification. Passing either message family through the actual translator and event assembler creates a provider/unhandled event instead of producing no timeline events. Three regression cases reproduce the defect on trusted main, and the same agent repeated all three failures in a second clean checkout. This is a provider classification bug, not a layout or styling defect. Live Claude emission, desktop rendering, and the reporter's operating-system/version claims were not exercised.

2. Claims vs findings

ClaimStatusEvidence
Session-title metadata creates an unhandled diagnostic event.Verified at provider boundaryRegression case with session_title_changed produces one provider/unhandled event.
Application-discovery metadata creates an unhandled diagnostic event.Verified at provider boundaryBoth iOS and Android dev_intent variants produce one event each.
Trusted main lacks classification for these messages.VerifiedExplicit subtype parser and coverage switch omit both values.
Live Claude CLI emits these messages under the reported project/fork conditions.UnverifiedNo live provider session, reporter data, or mobile projects were used.
Desktop diagnostics display the rows only when enabled.Not visually exercisedReproduced the underlying diagnostic events; no screenshot or desktop interaction is claimed.
Reported product/provider versions are the latest releases.Not assessedInvestigation targets the fetched main commit rather than release freshness.

3. Environment

Linux x86_64; Node v22.19.0; pnpm 9.15.0; Vitest 4.1.12. Source: public get-bb/bb, fetched origin/main at the commit above. Dependencies were installed with the frozen lockfile in each checkout. No dependency was added. No live server, provider session, database, browser, port, or runtime data directory was needed. All message identifiers in the regression are synthetic.

4. Minimal reproduction

  1. Clone trusted main, pin the recorded commit, and install/build the owning subsystem:
git clone --branch main https://github.com/get-bb/bb.git issue-7596-source
cd issue-7596-source
git checkout --detach da3e60b81d560e114a2bec724bb59c997aaaae7f
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build --filter=bb-plugin-provider-claude-code

Apply the following independently authored regression patch to the existing provider test. It invokes the real translator and assembler, with no provider mock:

git apply <<'PATCH'
diff --git a/plugins/provider-claude-code/src/delta-translation.test.ts b/plugins/provider-claude-code/src/delta-translation.test.ts
index d8a62a1b1..909779d65 100644
--- a/plugins/provider-claude-code/src/delta-translation.test.ts
+++ b/plugins/provider-claude-code/src/delta-translation.test.ts
@@ -1413,6 +1413,25 @@ describe("claude unhandled and ignored events", () => {
     expect(events).toMatchObject([]);
   });
 
+  it.each([
+    { subtype: "session_title_changed", title: "Metadata test session" },
+    { subtype: "dev_intent", kind: "ios_app", trigger: "project_scan" },
+    { subtype: "dev_intent", kind: "android_app", trigger: "project_scan" },
+  ])("ignores session metadata without diagnostic events: %j", (metadata) => {
+    const harness = createClaudeDeltaHarness();
+
+    const events = harness.translate(
+      sdkMessage({
+        type: "system",
+        ...metadata,
+        session_id: "metadata-session",
+        uuid: "metadata-message",
+      }),
+    );
+
+    expect(events).toEqual([]);
+  });
+
   it("ignores async hook lifecycle system events from the SDK envelope", () => {
     const harness = createClaudeDeltaHarness();
 
PATCH

Run the focused regression:

pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/delta-translation.test.ts -t 'ignores session metadata'

Expected: no timeline events for each informational metadata message; all three cases pass. Actual: all three cases fail because an unhandled event is returned. Verbatim assertion excerpt from the first run:

 FAIL  |bb-plugin-provider-claude-code| src/delta-translation.test.ts > claude unhandled and ignored events > ignores session metadata without diagnostic events: {"subtype":"session_title_changed","title":"Metadata test session"}
bb-plugin-provider-claude-code:test: AssertionError: expected [ Array(1) ] to deeply equal []
bb-plugin-provider-claude-code:test: 
bb-plugin-provider-claude-code:test: - Expected
bb-plugin-provider-claude-code:test: + Received
bb-plugin-provider-claude-code:test: 
bb-plugin-provider-claude-code:test: - []
bb-plugin-provider-claude-code:test: + [
bb-plugin-provider-claude-code:test: +   {
bb-plugin-provider-claude-code:test: +     "providerId": "claude-code",
bb-plugin-provider-claude-code:test: +     "providerThreadId": "",
bb-plugin-provider-claude-code:test: +     "rawEvent": {
bb-plugin-provider-claude-code:test: +       "jsonrpc": "2.0",
bb-plugin-provider-claude-code:test: +       "method": "sdk/message",
bb-plugin-provider-claude-code:test: +       "params": {
bb-plugin-provider-claude-code:test: +         "message": {
bb-plugin-provider-claude-code:test: +           "session_id": "metadata-session",
bb-plugin-provider-claude-code:test: +           "subtype": "session_title_changed",
bb-plugin-provider-claude-code:test: +           "title": "Metadata test session",
bb-plugin-provider-claude-code:test: +           "type": "system",
bb-plugin-provider-claude-code:test: +           "uuid": "metadata-message",
bb-plugin-provider-claude-code:test: +         },
bb-plugin-provider-claude-code:test: +         "threadId": "thr_claude_rate_limits",
bb-plugin-provider-claude-code:test: +       },
bb-plugin-provider-claude-code:test: +     },
bb-plugin-provider-claude-code:test: +     "rawType": "sdk/system",
bb-plugin-provider-claude-code:test: +     "scope": {
bb-plugin-provider-claude-code:test: +       "kind": "thread",
bb-plugin-provider-claude-code:test: +     },
bb-plugin-provider-claude-code:test: +     "threadId": "",
bb-plugin-provider-claude-code:test: +     "type": "provider/unhandled",
bb-plugin-provider-claude-code:test: +   },
bb-plugin-provider-claude-code:test: + ]
bb-plugin-provider-claude-code:test: 
bb-plugin-provider-claude-code:test:  ❯ src/delta-translation.test.ts:1432:20
bb-plugin-provider-claude-code:test:     1430|     );
bb-plugin-provider-claude-code:test:     1431|
bb-plugin-provider-claude-code:test:     1432|     expect(events).toEqual([]);
bb-plugin-provider-claude-code:test:        |                    ^
bb-plugin-provider-claude-code:test:     1433|   });
bb-plugin-provider-claude-code:test:     1434|
bb-plugin-provider-claude-code:test: 
bb-plugin-provider-claude-code:test: ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/3]⎯
bb-plugin-provider-claude-code:test: 
bb-plugin-provider-claude-code:test:  FAIL  |bb-plugin-provider-claude-code| src/delta-translation.test.ts > claude unhandled and ignored events > ignores session metadata without diagnostic events: {"subtype":"dev_intent","kind":"ios_app","trigger":"project_scan"}
bb-plugin-provider-claude-code:test: AssertionError: expected [ Array(1) ] to deeply equal []
bb-plugin-provider-claude-code:test: 
bb-plugin-provider-claude-code:test: - Expected
bb-plugin-provider-claude-code:test: + Received
bb-plugin-provider-claude-code:test: 
bb-plugin-provider-claude-code:test: - []
bb-plugin-provider-claude-code:test: + [
bb-plugin-provider-claude-code:test: +   {
bb-plugin-provider-claude-code:test: +     "providerId": "claude-code",
bb-plugin-provider-claude-code:test: +     "providerThreadId": "",
bb-plugin-provider-claude-code:test: +     "rawEvent": {
bb-plugin-provider-claude-code:test: +       "jsonrpc": "2.0",
bb-plugin-provider-claude-code:test: +       "method": "sdk/message",
bb-plugin-provider-claude-code:test:  Test Files  1 failed (1)
bb-plugin-provider-claude-code:test:       Tests  3 failed | 56 skipped (59)
bb-plugin-provider-claude-code:test:    Duration  1.11s (transform 550ms, setup 0ms, import 855ms, tests 34ms, environment 0ms)
  Time:    5.409s 
Failed:    bb-plugin-provider-claude-code#test

The patch above contains the full new test. It extends the canonical translator test owner and needs no new production export, test seam, or dependency. Existing UI-system tests cover unrelated known-noise messages and preservation of unknown-message diagnostics, but not these two metadata families.

5. Root cause

  1. The subtype parser recognizes an explicit list of names and maps everything else to unknown. Both metadata names are absent.
  2. The coverage switch therefore returns { kind: "sdk/system", coverage: "unknown" } instead of recognizing the metadata as noise.
  3. The SDK-envelope fallback runs after system translation returns no deltas. Its coverage gate suppresses known noise but emits an unhandled delta for unknown coverage.
  4. The event assembler converts that delta into the persisted-event shape provider/unhandled, with rawType: "sdk/system". The regression checks this real end-to-end provider path rather than merely testing a lookup.
const description = claudeCodeVisibilityMetadata.describeRawEvent(rawEvent);
if (description.coverage !== "unknown") {
  return [];
}

The deeper maintenance risk is an explicit subtype inventory drifting behind provider releases. This investigation does not justify silencing every future unknown subtype: unknown-event diagnostics are an intentional existing behavior protected by tests.

6. Proposed fix

Add only the two verified informational subtype names to the local subtype union, parser recognition switch, and noise branch in visibility.ts. Keep unknown subtype behavior unchanged. Keep the three regression cases at the actual SDK-envelope → assembled-event boundary; run the owning provider's existing tests, typecheck, lint, and whitespace check. No public protocol, schema, packaging, dependency, or stored-data change is needed.

7. Verification

The same agent created a second clean checkout from the same trusted commit, independently installed frozen dependencies and built the provider prerequisites, then applied only the test patch above. Production code was unchanged in both runs. The exact focused command was identical. No ports or data directories were allocated in either run, so there was nothing to share or clean up at runtime. This is a repeat verification, not independent-agent verification.

bb-plugin-provider-claude-code:test:  Test Files  1 failed (1)
bb-plugin-provider-claude-code:test:       Tests  3 failed | 56 skipped (59)
bb-plugin-provider-claude-code:test:    Duration  1.09s (transform 514ms, setup 0ms, import 817ms, tests 33ms, environment 0ms)
  Time:    5.245s 
Failed:    bb-plugin-provider-claude-code#test

Result: three expected assertion failures in each checkout, each showing an actual unhandled event where an empty list was required. No correction to the root-cause finding was necessary. Scope remains deterministic provider handling of these payloads; live emission frequency and fork-specific triggers remain unverified.

Candidate-fix validation

A local candidate adds the two names only to the existing subtype union, parser, and noise branch. Total change: 25 added lines across two files, including the regression. The three new cases pass after the fix, and all 74 tests in the affected translator, visibility, and UI-system suites pass. Typecheck, lint, and git diff --check also pass. Truly unknown messages remain diagnostic events.

pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/delta-translation.test.ts src/visibility.test.ts src/system-ui.test.ts
Test Files  3 passed (3)
Tests       74 passed (74)

pnpm exec turbo run typecheck lint --filter=bb-plugin-provider-claude-code
Tasks: 7 successful, 7 total

Broader-suite caveat: The entire provider suite was also run: 439 tests passed and six tests failed in installation-discovery and bridge-permission scenarios. Those same six failures were repeated against unchanged production code in the second checkout (108 passed, six failed across the two pre-existing bridge suites). They are not attributed to this visibility change and were not modified. This report does not claim that the entire provider suite is green.

pnpm exec turbo run test typecheck lint --filter=bb-plugin-provider-claude-code
Test Files  2 failed | 28 passed (30)
Tests       6 failed | 439 passed (445)

Unchanged production, second checkout:
pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/bridge/provider-maintenance.discovery.test.ts src/bridge/__tests__/bridge.test.ts
Test Files  2 failed (2)
Tests       6 failed | 108 passed (114)

8. Related issues and pull requests

At investigation time, both an open-PR search for this issue number and the issue's cross-reference timeline returned no linked open pull request. Trusted repository history records an earlier explicit-noise classification change in commit a0fe13536 (PR #5253); this investigation does not execute or adopt a linked PR branch.

9. Appendix

Preparation commands were the frozen install and targeted Turbo build shown above. Both clean runs used the exact test command shown above. Local raw logs and the patch were retained outside the public report repository. Only this HTML and its summary metadata are published. No screenshot is supplied because this report proves event classification, not a visual UI reproduction.

Trust boundary: Issue content was treated only as untrusted claims. No issue-supplied URL, script, patch, executable, branch, or test was fetched or run; no real user's runtime data was accessed. Reproduction inputs and regression code were authored against trusted repository interfaces.