← reports

#5252 · Claude plugin UI notifications generate diagnostics

BugPriority: LowEffort: Lowprovidersprovider-claude-codeGitHub issue2026-10-09 · base 9a47d42c78ca9689af0b78da9b3155a8c0b36251

Verdict: REPRODUCED at the provider translation boundary · Root-cause confidence: high

1. TL;DR

Seven plugin-UI system notification subtypes become diagnostic timeline events instead of being ignored. The provider first reduces an unrecognized system subtype to unknown, then converts that classification into provider/unhandled. Feeding independently authored notification envelopes through the real translator and shared event assembler reproduces the failure on trusted main. A second clean checkout gives the same seven failures. This report verifies the provider behavior, not the upstream CLI version at which these notifications first appeared.

2. Claims vs findings

ClaimFindingEvidence
Plugin-UI notifications are missing from the provider classification.VerifiedThe trusted allow-list rejects all seven tested subtypes; each input emits one provider/unhandled event.
Unhandled notifications become visible diagnostic rows.Verified in sourceThe timeline parser renders provider-unhandled events only when diagnostic operations are enabled, using the provider display name in the title. No live browser screenshot was taken.
Real plugins emit many such notifications on recent Claude CLI builds.UnverifiedNo live Claude plugin installation or authenticated turn was used. The reported frequency, macOS behavior, and upstream introduction version remain unverified.
Disabling diagnostics fixes classification.Refuted as a fixThe display filter hides the row but does not change provider classification or emitted events.
Other providers are unaffected.Not separately exercisedThe faulty subtype mapping and the candidate repair are local to the Claude provider.

3. Environment

4. Minimal reproduction

  1. Clone the trusted public repository and select the recorded main commit:
    git clone https://github.com/get-bb/bb.git bb-5252
    cd bb-5252
    git checkout --detach 9a47d42c78ca9689af0b78da9b3155a8c0b36251
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build
  2. Download the authored regression test and put it at plugins/provider-claude-code/src/system-ui.test.ts. It supplies ordinary SDK-message envelopes, not executable issue content.
  3. Run:
    pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/system-ui.test.ts
    Expected: no timeline events for the seven known UI notification subtypes; existing unknown-system diagnostics remain intact.
    Test Files  1 failed (1)
         Tests  7 failed | 3 passed (10)
    Actual: each UI notification produces one provider/unhandled event with rawType: "sdk/system"; the three unknown-system controls pass.

Complete baseline outputs: first run and second run. No screenshot is presented: this is an executable provider-event reproduction, not a live visual verification.

Regression test

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

describe("Claude plugin UI system pushes", () => {
  it.each([
    "ui_invalidate",
    "ui_log",
    "ui_toast",
    "ui_status",
    "ui_panes",
    "ui_scroll",
    "ui_focus",
  ])("ignores %s without creating diagnostic timeline events", (subtype) => {
    const harness = createClaudeDeltaHarness();

    const events = harness.translate({
      jsonrpc: "2.0",
      method: "sdk/message",
      params: {
        threadId: "ui-thread",
        message: {
          type: "system",
          subtype,
          session_id: "ui-session",
          uuid: "ui-message",
        },
      },
    });

    expect(events).toEqual([]);
  });

  it.each(["unrecognized_system_event", "ui_unrecognized", undefined])(
    "preserves diagnostics for an unsupported system subtype %s",
    (subtype) => {
      const harness = createClaudeDeltaHarness();

      const events = harness.translate({
        jsonrpc: "2.0",
        method: "sdk/message",
        params: {
          threadId: "ui-thread",
          message: { type: "system", subtype },
        },
      });

      expect(events).toEqual([
        expect.objectContaining({
          type: "provider/unhandled",
          rawType: "sdk/system",
          providerId: "claude-code",
          scope: threadScope(),
        }),
      ]);
    },
  );
});

5. Root cause

Subtype parsing uses a closed allow-list, so these notifications lose their subtype and become unknown:

    case "task_notification":
    case "task_progress":
    case "task_started":
    case "task_updated":
    case "thinking_tokens":
      return subtype;
    default:
      return "unknown";
  }

Visibility classification maps that case to { kind: "sdk/system", coverage: "unknown" }. The translator emits an unhandled delta whenever coverage is unknown:

  function unhandledDeltas(
    rawEvent: JsonRpcMessage,
    parentRef: string | undefined,
  ): ThreadDelta[] {
    const description = claudeCodeVisibilityMetadata.describeRawEvent(rawEvent);
    if (description.coverage !== "unknown") {
      return [];
    }
    return [
      {
        kind: "unhandled",
        raw: toRawEvent(rawEvent),
        rawType: description.kind,
        vouchedTurn: true,
        ...(parentRef ? { parentRef } : {}),
      },
    ];
  }

The existing shared event assembler converts the delta to provider/unhandled, which the regression asserts directly. The timeline parser constructs the diagnostic title:

  if (decoded.type === "provider/unhandled") {
    if (options?.includeDiagnosticOperations !== true) {
      return null;
    }

    return op(decoded, meta, "provider-unhandled", {
      opType: "provider-unhandled",
      title: `Unhandled ${providerDisplayName(
        decoded.providerId,
        options?.providerDisplayName,
      )} event`,
      detail: buildProviderUnhandledDetail(decoded),
      status: "completed",
    });
  }

The deeper maintenance risk is SDK subtype drift: new kinds need explicit coverage decisions. Globally suppressing unknown events would conceal unrelated unexpected or malformed envelopes.

6. Proposed fix and validation

Recognize the seven tested UI notification subtypes in the provider-local subtype union and parser, then classify them as noise in the existing visibility switch. Do not introduce a generic prefix rule or change the unknown fallback. The candidate changes only the provider visibility implementation and one regression test: 78 added text lines, zero deletions, two files; no protocol, schema, permission, dependency, packaging, or stored-data change.

The focused regression passes after the repair: 10/10. Provider lint and typecheck pass. The full provider suite initially reports five baseline failures under root; the same bridge failures occur in unchanged production code. A non-root user namespace resolves the environment mismatch without editing those tests or unrelated production behavior:

unshare --user --map-user=1000 --map-group=1000   env HOME="$ISOLATED_HOME" XDG_CACHE_HOME="$ISOLATED_CACHE"   pnpm exec turbo run test --filter=bb-plugin-provider-claude-code --cache=local:r

Test Files  26 passed (26)
     Tests  385 passed (385)

Artifacts: fixed regression, root validation including lint/typecheck, unchanged baseline bridge failures, and complete passing non-root suite.

7. Verification

The same agent created a second clean worktree at 9a47d42c78ca9689af0b78da9b3155a8c0b36251, completed its frozen install and provider dependency build, copied only the independently authored regression file, and ran pnpm exec turbo run test --filter=bb-plugin-provider-claude-code -- src/system-ui.test.ts. The result was again exactly seven failing UI cases and three passing unknown-system controls. Its visibility implementation remained unchanged. This is a second clean reproduction, not an independent review. No correction to the provider root cause was needed; live upstream emission and macOS frequency remain explicitly unverified.

8. Related issues and PR checks

There was no linked or matching open pull request for issue #5252 in GitHub timeline metadata and an open-PR search before the candidate fix. Repository history shows the same allow-list previously gained a background-task subtype in commit cb899e52d16ea7a5d87f25b3c673a3047aa7020a, merged via #2893. That establishes the existing explicit-classification design, not the upstream semantics of every future event.

9. Appendix and trust boundary

Issue content was treated only as untrusted hypotheses. No linked external URL, issue-supplied script, patch, binary, test, or PR branch was fetched or executed. Tests and the candidate repair were authored from the trusted provider path. No real instance data or credentials were accessed. Artifact paths are normalized to temporary-checkout names.

Commands performed include canonical-repository and property reads; fetch of origin/main; two detached worktree creations; frozen pnpm installs; trusted-base Turbo build; focused reproduction runs; provider test/typecheck/lint validation; unchanged baseline bridge testing; and full-suite execution in a non-root user namespace. All evidence links target the recorded main commit, not a proposed branch.