Reports

#8335 · MCP authentication status is discarded by provider translation

BugPriority: MediumEffort: Highproviders · threads · provider-codex · provider-claude-code

Issue #8335 · 2026-11-29 · trusted origin/main b0ddaad731565d7e4de68d824120d802fc78f7d5

Verdict: PARTIALLY REPRODUCED · Root-cause confidence: high · reproduction label: partial-repro

1. TL;DR

Both provider translators discard messages that contain an MCP authentication requirement. Codex emits no deltas for an authentication-specific startup failure, while Claude Code emits none for an initialization message containing a server that needs authentication. This was reproduced twice using fresh detached checkouts of the same trusted main commit, without provider credentials or live accounts. Existing Codex warnings still translate, and ordinary non-authentication startup failures remain suppressed. The translation defect is confirmed; browser sign-in, remote callbacks, timeline rendering, persistence, and reload behavior were not exercised, so the broader report receives a partial verdict.

2. Claims vs findings

ClaimFindingEvidence
Codex loses the authentication startup notice.VerifiedProduction translator returns [] for reauthenticationRequired in both runs.
Claude Code loses needs-auth status from initialization.Verified at translation boundaryProduction translator returns [] for an sdk/message system/init containing needs-auth in both runs.
Non-authentication startup failures should remain silent.Verified controlCodex failureReason: null returns []; connected Claude initialization is silent.
A running Claude session never surfaces a changed mcpServerStatus response.Static evidence onlyThe inspected status query is a context-probe check for the bridge server; no live changed-status session was run.
Remote OAuth callbacks, inline sign-in and signed-in persistence work or fail in a specific way.UnverifiedNo live OAuth, browser, network callback, storage or timeline test was performed.

3. Environment

4. Minimal reproduction

  1. Create a fresh checkout and install the frozen dependencies.
git clone https://github.com/get-bb/bb.git bb-8335-a
cd bb-8335-a
git checkout --detach b0ddaad731565d7e4de68d824120d802fc78f7d5
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build:types --filter=@get-bb/plugin-sdk
pnpm exec turbo run build --filter=bb-plugin-provider-codex --filter=bb-plugin-provider-claude-code

Save the following two files at the indicated paths. They are investigator-written tests derived from trusted production code, not scripts supplied by the issue. The assertion requires only that authentication status not vanish; a complete regression test for a chosen fix must additionally assert the actual notice content, scope and action contract.

plugins/provider-codex/src/slopcop-8335.test.ts

import { describe, expect, it } from "vitest";
import { createCodexEventTranslator } from "./translator.js";

describe("MCP authentication notification delivery", () => {
  function startupFailure(failureReason: string | null) {
    return createCodexEventTranslator({
      additionalWorkspaceWriteRoots: [],
    }).translateEvent({
      jsonrpc: "2.0",
      method: "mcpServer/startupStatus/updated",
      params: {
        threadId: "test-thread",
        name: "example-mcp",
        status: "failed",
        error: "Example MCP startup failure",
        failureReason,
      },
    });
  }

  it("delivers existing provider warnings as a positive control", () => {
    const deltas = createCodexEventTranslator({
      additionalWorkspaceWriteRoots: [],
    }).translateEvent({
      jsonrpc: "2.0",
      method: "warning",
      params: { threadId: "test-thread", message: "Example warning" },
    });
    expect(deltas).toContainEqual(expect.objectContaining({ kind: "provider.warning" }));
  });

  it("keeps non-authentication startup failures suppressed", () => {
    expect(startupFailure(null)).toEqual([]);
  });

  it("does not discard a startup failure requiring reauthentication", () => {
    const deltas = startupFailure("reauthenticationRequired");
    console.log("Authentication startup deltas:", JSON.stringify(deltas));
    expect(deltas).not.toEqual([]);
  });
});

plugins/provider-claude-code/src/slopcop-8335.test.ts

import { describe, expect, it } from "vitest";
import { createClaudeDeltaTranslator } from "./delta-translation.js";

describe("MCP authentication initialization delivery", () => {
  function initialize(status: string) {
    return createClaudeDeltaTranslator({
      sandboxEnabled: false,
      commandDescriptionsEnabled: false,
    }).translate({
      jsonrpc: "2.0",
      method: "sdk/message",
      params: {
        threadId: "test-thread",
        message: {
          type: "system",
          subtype: "init",
          session_id: "test-session",
          mcp_servers: [{ name: "example-mcp", status }],
        },
      },
    }, { threadId: "test-thread" });
  }

  it("keeps connected server initialization silent", () => {
    expect(initialize("connected")).toEqual([]);
  });

  it("does not discard initialization requiring authentication", () => {
    const deltas = initialize("needs-auth");
    console.log("Authentication initialization deltas:", JSON.stringify(deltas));
    expect(deltas).not.toEqual([]);
  });
});

Run the existing Turbo-orchestrated package test tasks:

pnpm exec turbo run test --force --filter=bb-plugin-provider-codex --filter=bb-plugin-provider-claude-code -- --run src/slopcop-8335.test.ts

Expected: a nonempty authentication notice delta from each authentication input; the existing warning control translates, and the two silent controls stay silent. Actual excerpts from both runs:

Authentication startup deltas: []
Authentication initialization deltas: []
AssertionError: expected [] to not deeply equal []

Codex:       Tests  1 failed | 2 passed (3)
Claude Code: Tests  1 failed | 1 passed (2)
Command exit status: 1

This is a translation-level defect, not a screenshot-based UI claim. No screenshots were manufactured. The tests and relevant output are embedded here rather than publishing raw logs or runtime data.

5. Root cause

Codex: startup status is classified as noise. The raw-event parser reduces the entire startup event to a generic kind, so the authentication failure reason cannot influence its visibility. The descriptor returns noise regardless of the payload. The event has no handled translation; the fallback path therefore reaches buildUnhandledCodexDeltas, which returns [] for known coverage without an explicit rawType. Thus authentication failure and ordinary startup noise take the same discard path.

case "mcp-startup-status":
  return { kind: "mcpServer/startupStatus/updated", coverage: "noise" };

if (description.coverage !== "unknown" && args.rawType === undefined) {
  return [];
}

Claude Code: The bridge forwards sdk/message and refreshes provider commands for init, but does not extract an authentication notice. translateSystemMessage has no MCP-authentication branch and falls through to []. Its SDK-envelope fallback cannot recover a visible warning because init is classified as noise. The separately inspected mcpServerStatus call checks the bridge server for a context-usage probe, rather than publishing user-server authentication requirements. The shared failure is missing semantic extraction before generic initialization/startup noise suppression.

6. Proposed fix and safety

Handle authentication-specific MCP status before applying the existing noise policy, while retaining suppression for unrelated startup failures. Normalize the notice into a thread-scoped persistent event and route UI, CLI and SDK actions through the same server-owned implementation. A full sign-in solution also needs provider-specific OAuth lifecycle handling, credential-safe URL handling, callback target validation restricted to the intended loopback listener, and reload-safe completion state. Those changes require explicit protocol/authentication/security decisions and are not an autopilot simple fix. Do not merely unsuppress every startup event.

7. Linked pull request

PR #8336 was OPEN against main and its GitHub closing-issue metadata explicitly linked #8335. Metadata reported 78 files, 4,382 additions and 42 deletions at inspection. The diff was read only as untrusted data: its file inventory spans timeline UI, CLI, server/daemon and contract code, consistent with the cross-subsystem scope. No branch was checked out, no PR code or tests were executed, and no correctness or security approval is offered. The main-branch reproduction tests here do not validate that PR. A duplicate fix PR was not created because the linked open PR already addresses this issue.

8. Verification

The same investigator repeated the test in checkout B, a separately created clean detached worktree at the identical full base commit. Frozen installation, SDK type generation and scoped build tasks completed there before adding the two investigator tests. No generated modules, node_modules symlink, source changes or runtime state were copied from checkout A. Only the two authored test files were copied.

git rev-parse HEAD
b0ddaad731565d7e4de68d824120d802fc78f7d5
git status --short
# empty before adding the reproduction tests

pnpm exec turbo run test --force --filter=bb-plugin-provider-codex --filter=bb-plugin-provider-claude-code -- --run src/slopcop-8335.test.ts
RunCodexClaude CodeExit
Checkout A, 2026-11-29 05:39 UTC1 intended failure; 2 controls pass1 intended failure; 1 control passes1
Checkout B, 2026-11-29 05:40 UTC; forced execution1 intended failure; 2 controls pass1 intended failure; 1 control passes1

The second run supports the final translation-level finding. No contradictory result or correction was necessary. This is a repeated clean-checkout check by the same agent, not an independent investigation.

9. Related issues and limits

No additional related issue was validated or used as evidence. This report does not establish provider OAuth server availability, actual account expiry, browser callback transport, completed sign-in persistence, turn expansion or remote-host behavior. Synthetic inputs exercise the real production translators, not the external providers. No fix was attempted or pushed.

10. Appendix

The initial normal frozen install succeeded. An attempted repository-wide pnpm exec turbo run build stopped in the GitHub plugin because SDK process/host dist entries were absent in the fresh checkout. That unrelated build failure is not the reproduction result. After the repository-prescribed SDK build:types step, scoped build tasks succeeded in both checkouts, and both focused test executions loaded the production translators and failed at the intended assertions. No whole-repository build success is claimed. No dependencies were added.

Raw evidence remains outside the public report repository. Source permalinks were checked against the recorded trusted main commit. Issue text and linked-PR content were treated solely as untrusted claims: no issue command, linked branch, patch or test was executed.

AGENT GENERATED