← reports

#7665 · ACP session metadata has no retry diagnostic translation

BugPriority: Medium Effort: Mediumprovidersprovider-acp GitHub issueNovember 17, 2026

Verdict: REPRODUCED · Root-cause confidence: high, specifically for loss at the translator boundary.

Trusted base: de34f3492e4c69ade967e7b9b1345c9e8d62b03d, fetched from the target repository's main branch. A later fetch reached da39507dd3ad1bbc2b05ba046216f576330045e8; the translator, delta contract, and timeline files cited here were unchanged.

1. TL;DR

A pending provider retry can carry an explanation, but BB's ACP translator does not turn this session metadata into any diagnostic event. Two fresh main-branch checkouts produced no deltas for a retry-only update and only a rename for an update that also had a title. The real translator and real delta assembler were exercised with synthetic input; the running turn stayed open in both cases. This confirms the information-loss mechanism, not live OpenCode emission, the exact user-visible waiting state, or push delivery. No model request, live BB instance, or user database was used.

2. Claims vs findings

ClaimFindingEvidence
Retry-only session metadata produces no diagnostic.VerifiedThe real translator returned []; the real assembler emitted no events.
A title combined with retry metadata preserves only the title.VerifiedThe only delta was thread.name; the only event was thread/name/updated.
This occurs while a prompt is still pending.Verified at the boundaryThe test opened a turn first, then verified the same turn remained open and no completion event was emitted.
OpenCode emits this exact metadata shape and clears it with null.Unverified upstreamNo external documentation or issue-supplied URL was fetched. Synthetic metadata tested BB's handling; no live OpenCode process was run.
The UI and notifications explain a real provider wait.Not exercised end to endNo UI, transport subprocess, persistence, notifications, or real provider failure was induced.
Other tool-completion changes repair this path.Not supported by mainThe current session metadata case has only title logic and no retry handling.

3. Environment

4. Minimal reproduction

  1. Clone the public target repository and check out the trusted base. Use Node 22.19.0 or a compatible supported runtime:
    git clone https://github.com/get-bb/bb.git bb-repro
    cd bb-repro
    git checkout --detach de34f3492e4c69ade967e7b9b1345c9e8d62b03d
    pnpm install --frozen-lockfile --prefer-offline
    pnpm exec turbo run build --filter=@get-bb/plugin-sdk
    pnpm exec turbo run build
    The first broad build in the initial checkout failed because plugin SDK runtime outputs were not built yet. Building that existing SDK target and retrying fixed setup; the broad build then passed all 74 tasks. The second clean checkout built the SDK first and passed all 74 broad-build tasks as well.
  2. Create packages/provider-bridge-acp/src/retry-metadata.regression.test.ts with the complete test below. This independently authored test uses repository entry points, not the issue's extracted-handler script.
    import { describe, expect, it } from "vitest";
    import { createDeltaAssembler } from "@bb/provider-bridge-protocol/assembler";
    import {
      ACP_TURN_STARTED_METHOD,
      ACP_UPDATE_METHOD,
    } from "./bridge-protocol.js";
    import { createAcpDeltaTranslator } from "./delta-translation.js";
    
    describe("ACP pending retry diagnostics", () => {
      it.each([false, true])("retains diagnostic data with title=%s", (withTitle) => {
        const threadId = "retry-regression-thread";
        const translator = createAcpDeltaTranslator({ cwd: "/workspace" });
        const assembler = createDeltaAssembler({
          providerId: "acp",
          entropyPrefix: "retry-regression",
          textDeltaFlushMs: 0,
        });
        const opening = translator.translateAcpEvent(
          {
            jsonrpc: "2.0",
            method: ACP_TURN_STARTED_METHOD,
            params: { threadId },
          },
          { threadId },
        );
        assembler.assemble({ threadId, deltas: opening });
        const openTurnId = assembler.getOpenTurnId(threadId);
        expect(openTurnId).toBeTruthy();
    
        const diagnostic = {
          attempt: 3,
          nextRetryAt: "2026-01-01T00:00:30.000Z",
          error: {
            type: "provider.unavailable",
            message: "Synthetic upstream maintenance response",
            status: 503,
          },
        };
        const deltas = translator.translateAcpEvent(
          {
            jsonrpc: "2.0",
            method: ACP_UPDATE_METHOD,
            params: {
              threadId,
              update: {
                sessionUpdate: "session_info_update",
                ...(withTitle ? { title: "Diagnostic test title" } : {}),
                _meta: { "opencode/retry": diagnostic },
              },
            },
          },
          { threadId },
        );
        const events = assembler.assemble({ threadId, deltas });
        console.info(JSON.stringify({ withTitle, deltas, events }));
        expect(assembler.getOpenTurnId(threadId)).toBe(openTurnId);
        expect(events.some((event) => event.type === "turn/completed")).toBe(false);
        if (withTitle) {
          expect(events).toContainEqual(
            expect.objectContaining({
              type: "thread/name/updated",
              threadName: "Diagnostic test title",
            }),
          );
        }
        const preserved = JSON.stringify(events);
        expect(preserved).toContain(diagnostic.error.message);
        expect(preserved).toContain(String(diagnostic.error.status));
        expect(preserved).toContain(diagnostic.nextRetryAt);
        expect(preserved).toContain(String(diagnostic.attempt));
      });
    });
    
  3. Run the new regression through the package's normal Turbo test target:
    pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/retry-metadata.regression.test.ts

Expected: a non-terminal assembled event retains the synthetic provider message, HTTP status, attempt, and next retry timestamp; the open turn remains open and a simultaneous title still produces its normal rename event. The test intentionally does not prescribe a new event kind.

Actual trace, verbatim from both executions:

{"withTitle":false,"deltas":[],"events":[]}
{"withTitle":true,"deltas":[{"kind":"thread.name","name":"Diagnostic test title","source":"agent"}],"events":[{"type":"thread/name/updated","threadId":"","providerThreadId":"","scope":{"kind":"thread"},"threadName":"Diagnostic test title","source":"agent"}]}

Both runs exited 1 with Tests 2 failed (2). Both failed at the diagnostic-preservation assertion, after the open-turn, non-completion, and conditional title assertions passed. The first assertion failure was:

Expected: "Synthetic upstream maintenance response"
Received: "[]"

The title-bearing case received only the rename event shown in the trace. No error text, status, attempt, or timestamp was present in either output.

The test is deliberately red evidence, not a committed production change. Reproduction code and exact evidence are inline because this report repository forbids publishing separate test files and logs.

5. Root cause

The boundary schema accepts generic session updates with passthrough fields, so metadata can reach the translator: wire.ts:197–211. The bridge validates the session identity before forwarding the update: bridge notification handling, then emits it through ACP_UPDATE_METHOD: emitSessionUpdate. These transport observations are static source evidence; the runtime reproduction begins at that internal ACP notification boundary.

The translator's complete session-info case reads only the title, returns early for a missing or unusable title, and otherwise returns exactly one rename delta:

      case "session_info_update": {
        const title = isJsonObject(update) ? update["title"] : undefined;
        if (
          typeof title !== "string" ||
          title.trim() === "" ||
          title.trimStart().startsWith(SYSTEM_INSTRUCTIONS_OPEN_TAG) ||
          title === lastAgentTitle
        ) {
          return [];
        }
        lastAgentTitle = title;
        return [{ kind: "thread.name", name: title, source: "agent" }];
      }

No metadata is inspected. Because this is a recognized update kind, the default unhandled-event fallback is not reached either. The assembler cannot surface data for which it receives no delta. Title validation and deduplication should remain independent of diagnostic handling.

There is an existing non-terminal error path: provider.error can set willRetry: true without settling the turn: assembler behavior and existing keep-open regression. However, the provider/error event contract has a required message, no retry-status identity, and no null/clear operation. The timeline represents willRetry errors as reconnect rows and collapses consecutive reconnect rows; that is not an explicit transient diagnostic-clear lifecycle.

6. Proposed fix and simple-fix check

Validate the provider extension at the ACP boundary, then translate retry diagnostics independently from title changes. Preserve the source error text, optional status, attempt, and retry time without interpreting every HTTP rate limit as a daily quota problem. Keep the active prompt alive and do not dispatch additional requests. Define how explicit null, successful progress, completion, interruption, and a new prompt clear the active status without losing historical diagnostics or leaking state across threads.

No automatic fix or PR: a translator-only append of provider.error would expose the message but would not implement explicit status clearing. Choosing and wiring a lifecycle-aware presentation contract crosses the existing translator and timeline/domain responsibilities and requires a product/contract decision. That fails the autopilot's one-subsystem, no-product-decision constraints. No production patch or fix branch was created or pushed.

Tests for a future approved fix should add explicit-null clearing, prompt completion and cancellation, repeated titles, malformed metadata, missing HTTP status, and thread isolation at the selected lifecycle owner. If that choice changes server/daemon wire semantics, follow the repository's protocol-version policy.

No open pull request linked this issue in the cross-reference timeline or the open-PR search at investigation time. No linked PR code was run.

7. Related issues

The reported broader ACP capability discussion is #7471; this report is limited to the proven session metadata translation loss and makes no verdict about that broader discussion. No duplicate with the same isolated root cause was identified in the bounded issue/PR checks.

8. Verification

The same agent repeated the reproduction in a second newly created, initially clean detached checkout at de34f3492e4c69ade967e7b9b1345c9e8d62b03d, with its own dependency installation and no shared runtime instance or database. After copying only the independently authored test, the exact Turbo command from section 4 again failed both cases at the same assertion. The captured diagnostic traces were byte-for-byte identical. This is a second clean run, not an independent investigation.

Existing coverage on unchanged production code also passed:

pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/delta-translation.test.ts
Test Files 1 passed (1)
Tests 91 passed (91)

No report claim required correction after the repeat run. The later-main comparison showed no changes to the translator, delta schema, or timeline files cited here. Root-cause permalinks are pinned to the tested base. No screenshots were needed for this non-visual boundary regression.

9. Appendix and safety

The investigation read the issue and comments, current GitHub properties and labels, repository visibility, bounded related-issue results, open PR metadata, and cross-reference events. Issue text, code blocks, and links were treated as untrusted claims. No issue-supplied script, external link, patch, or linked branch was executed or fetched.

Recorded command families, with scratch locations omitted for privacy:

gh api repos/get-bb/bb
gh issue view 7665 --repo get-bb/bb --json number,title,body,comments,labels,url
gh api graphql [repository properties, issue fields, labels, cross-reference metadata]
gh label list --repo get-bb/bb --limit 200 --json name
gh issue list --repo get-bb/bb [bounded area and retry searches]
gh pr list --repo get-bb/bb --state open --search 7665 --json number,url
git fetch https://github.com/get-bb/bb.git main:refs/remotes/origin/main
git worktree add --detach [first scratch checkout] de34f3492e4c69ade967e7b9b1345c9e8d62b03d
git worktree add --detach [second scratch checkout] de34f3492e4c69ade967e7b9b1345c9e8d62b03d
pnpm install --frozen-lockfile --prefer-offline
pnpm exec turbo run build
pnpm exec turbo run build --filter=@get-bb/plugin-sdk
pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/retry-metadata.regression.test.ts
pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/delta-translation.test.ts
git diff --check
git diff de34f3492e4c69ade967e7b9b1345c9e8d62b03d origin/main -- [translator, delta contract, timeline]
diff -u [first diagnostic trace] [second diagnostic trace]

All GitHub mutations, including classification and the final issue comment, use the caller-supplied SlopCop write command. There were no live servers, browser sessions, API inference calls, or user-data modifications to clean up. Local raw build/test logs and the test source remain in thread storage; none are separately published.