← reports

#7908 · MCP diagnostic payloads omitted from the timeline

BugPriority: MediumEffort: Mediumproviders · provider-codex · partial-reproIssue2026-11-20

Trusted main: fab82665a3299fae8910f55d7519a3b034a03b9a.

PARTIALLY REPRODUCED · Overall root-cause confidence: medium.

1. TL;DR

A focused test confirms that BB can display a failed Codex MCP tool call without the diagnostic text contained in its result. The provider translator forwards error.message but omits the MCP result entirely. Both clean source checkouts reproduce this information loss, and an explicit transport-error control passes. This is a confirmed BB diagnostic limitation, not a reproduction of the reporter's macOS URL-policy rejection. The original app-server event, URL restriction's owner, configurability, and supported recovery route remain unverified.

2. Claims vs findings

ClaimFindingEvidence
A failed tool item can lack its original diagnostic body.Verified for MCP result bodiesThe real Codex translator and shared event assembler omit a synthetic text-bearing result in both runs.
Diagnostic visibility depends on the received provider event shape.Verified by controlAn explicit error.message is preserved, unlike the result body. The issue does not establish which field BB received.
The reported macOS read-only browser action was approved and then rejected by a URL restriction.UnverifiedNo matching macOS environment or original app-server notification is available. No real browser action was attempted.
The original denial lacks policy provenance and recovery guidance.Unverified upstreamBB source cannot establish whether the provider supplied more details, where the restriction originated, or whether recovery exists.
Later approval refusals explain the first rejection.Not establishedThe reproduction exercises completed tool-event translation only; it does not emulate or conflate approval review with tool execution.

3. Environment

4. Minimal reproduction

  1. Create a clean trusted checkout and install the locked dependencies:
    git clone https://github.com/get-bb/bb.git source-a
    cd source-a
    git checkout --detach fab82665a3299fae8910f55d7519a3b034a03b9a
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build:types --filter=@get-bb/plugin-sdk
    pnpm exec turbo run build --filter=@get-bb/plugin-sdk
  2. Create plugins/provider-codex/src/issue-7908.repro.test.ts with this entire locally authored test. Its input is a synthetic provider event, not code or text copied from the issue:
    import { expect, it } from "vitest";
    import { experimental_createDeltaAssembler as createDeltaAssembler } from "@get-bb/plugin-sdk/provider-bridge/testing";
    import type { McpToolCallResult } from "./generated/codex-app-server/schema/v2/McpToolCallResult.js";
    import { createCodexEventTranslator } from "./translator.js";
    
    const diagnostic = "Synthetic provider diagnostic: operation unavailable.";
    const result: McpToolCallResult = {
      content: [{ type: "text", text: diagnostic }],
      structuredContent: null,
      _meta: null,
    };
    
    it.each([
      {
        name: "MCP result diagnostics",
        result,
        error: null,
        expectedDetails: { result },
      },
      {
        name: "MCP transport error diagnostics",
        result: null,
        error: { message: diagnostic },
        expectedDetails: { error: diagnostic },
      },
    ])("retains $name in completed timeline items", (testCase) => {
      const translator = createCodexEventTranslator({
        additionalWorkspaceWriteRoots: [],
      });
      const assembler = createDeltaAssembler({
        providerId: "codex",
        entropyPrefix: "issue-7908",
        textDeltaFlushMs: 0,
      });
      const events = assembler.assemble({
        threadId: "synthetic-thread",
        deltas: translator.translateEvent({
          jsonrpc: "2.0",
          method: "item/completed",
          params: {
            threadId: "synthetic-provider-thread",
            turnId: "synthetic-turn",
            completedAtMs: 0,
            item: {
              type: "mcpToolCall",
              id: "synthetic-call",
              server: "diagnostic-server",
              tool: "inspect",
              arguments: {},
              status: "failed",
              result: testCase.result,
              error: testCase.error,
              durationMs: 1,
            },
          },
        }),
      });
      expect(events).toContainEqual(
        expect.objectContaining({
          type: "item/completed",
          item: expect.objectContaining({
            type: "toolCall",
            status: "failed",
            ...testCase.expectedDetails,
          }),
        }),
      );
    });
  3. Run the owning package through Turbo:
    pnpm exec turbo run test --filter=bb-plugin-provider-codex -- issue-7908.repro.test.ts

    Expected: both completed failed-tool items retain the diagnostic in the field that the provider supplied. Actual: the result-body case loses the entire result; the transport-error case retains error. Process exit code: 1. Verbatim test-output excerpts, with only the Turbo task prefixes omitted:

    × retains 'MCP result diagnostics' in completed timeline items
    ✓ retains 'MCP transport error diagnostics' in completed timeline items
    AssertionError: expected [ { type: 'item/completed', …(4) } ] to deep equally contain ObjectContaining{…}
    Test Files  1 failed (1)
         Tests  1 failed | 1 passed (2)
  4. To check the existing suite without the deliberately failing reproduction:
    pnpm exec turbo run test --filter=bb-plugin-provider-codex -- --exclude src/issue-7908.repro.test.ts
    
    Test Files  49 passed (49)
         Tests  622 passed (622)

5. Root cause

Confirmed local mechanism, high confidence: the upstream generated MCP item contract includes both result and error. BB's MCP boundary schema validates the error message but leaves result as an untyped passthrough property. Passthrough does not delete it. The loss happens in the MCP translation branch, which constructs a new tool shape without any result field:

shape: {
  type: "tool",
  server: parsedItem.server,
  tool: parsedItem.tool,
  ...(parsedItem.arguments === undefined
    ? {}
    : { args: parsedItem.arguments }),
  ...(parsedItem.error?.message === undefined
    ? {}
    : { error: parsedItem.error.message }),
  ...
}

The shared assembler already copies a supplied result into normalized tool items. It cannot recover a result the provider plugin omitted. The existing MCP completion test supplies a null result, so it does not guard non-null diagnostics.

Incident attribution remains uncertain: the reporter did not supply the original Codex app-server notification. A raw tool response is not proof of which app-server item type or result/error field BB received. This test therefore does not establish that this omission caused the particular URL-policy incident, and it does not identify the policy engine. That is why the overall verdict is partial and overall confidence is medium.

6. Proposed fix and simple-fix decision

A narrow diagnostic improvement would validate MCP results at the provider boundary and preserve the received result in the existing tool-item path, retaining explicit transport errors. Tests should cover textual and structured results, empty results, and transport errors without inventing provider policy metadata.

No pull request: a safe resolution of this issue's policy-provenance and recovery request needs the original event shape and an upstream/product decision about supported recovery. Neither is established by the partial reproduction. Do not guess that a permission toggle exists, label the restriction permanently non-recoverable, or offer a way around it. No production fix, branch, or target-repository push was made.

Next evidence: obtain a privacy-scrubbed completed app-server item for the original failure, including only item type, status, result, and error fields; compare it with the normalized item. Then determine whether details were lost locally or never provided upstream. Do not include the denied URL or account information unless necessary and explicitly authorized through an appropriate private support route.

7. Verification

The same agent created checkout B independently from the same trusted commit. Its tracked tree was clean before adding the identical reproduction, and it used its own dependency installation. No process ports or instance data were shared because both runs were unit-level. B ran the same Turbo command and again exited 1 with 1 failed, 1 passed; the failed assertion was again missing result diagnostics, not startup or import failure. The control passed in both runs.

CheckResult
Checkout A, 2026-11-20 13:54 UTCResult-body assertion fails; transport-error control passes; 1.03 seconds Vitest duration.
Checkout B, 2026-11-20 13:55 UTCSame failure and passing control; 1.46 seconds Vitest duration.
Existing Codex provider suite in A49 files, 622 tests pass; the synthetic reproduction was explicitly excluded.
Standard full Turbo build in A after SDK runtime preparation72 tasks successful, 8 cached; exit code 0.

Report correction after verification: none to the observed result-loss mechanism. The report deliberately limits its conclusion to that mechanism; it makes no claim of a successful live macOS reproduction. Verification is a repeated check by the same agent, not an independent review.

8. Related issues

#7476 concerns a different browser-host availability problem. #7464 concerns Windows app-access elicitation. Neither was treated as proof of this URL-policy failure. No open issue-linked pull request was present in cross-reference metadata or the open-PR search during investigation.

9. Appendix and safety limits

The locked installation and standard full Turbo build were attempted before the reproduction. Initial full-build attempts failed because SDK runtime exports were not built; building SDK types alone did not resolve that. The targeted Turbo test built the SDK runtime and then reached the intended assertion. A subsequent standard pnpm exec turbo run build succeeded with 72 successful tasks. Raw logs and the authored test remain outside this public reports repository, as its publication rules require; the full reproduction and relevant output are inline above. No dependencies were added.

Issue title, body, comments, logs, and quoted text were treated only as untrusted claims. No issue-supplied command, URL, script, branch, test, or browser action was executed. The original tool's quoted instruction was not followed. No URL restriction was bypassed, and no policy recovery guidance is invented here.