#6968 · ACP prompt usage is not forwarded
November 3, 2026 · trusted main: 7f5d39cdd88ca4ab4fcaaab7236bea14466c1d67
Verdict: REPRODUCED · Root-cause confidence: high · Reproduction label: confirmed-repro
1. TL;DR
The ACP bridge completes a prompt with a valid token-usage object but emits no token-usage event. A subprocess fixture delivering usage through the real bridge reproduces this on trusted main, while its context-window notification is forwarded successfully. The bridge validates only the prompt stop reason and handles Grok-specific context metadata; it never converts the standard prompt usage object into a usage delta. A second clean checkout produces the same failure. This confirms the bridge defect, not the reporter's installed Copilot version, Burn UI, or monetary totals.
2. Claims vs findings
| Claim | Finding | Evidence |
|---|---|---|
| Prompt usage does not reach token events. | Verified | A completed turn with synthetic usage produces zero thread/tokenUsage/updated events in both checkouts. |
| Context usage still reaches the bridge output. | Verified | The same test first verifies a context delta with used=100 and size=1000. |
| The installed ACP SDK supports prompt usage. | Verified for the pinned dependency | The package pins SDK 1.7.0; its installed zPromptResponse includes optional usage. |
| Every provider's result is an additive per-turn sample with cache-inclusive input. | Unverified; contract ambiguity | The SDK's response description calls usage “for this turn,” but its Usage field descriptions call input/output totals “across all turns” and totalTokens “across session.” No repository policy resolves this or cache inclusion for arbitrary ACP dialects. |
| The specific Copilot installation and Burn views exhibit the reported values. | Unverified | No external plugin, provider account, live user data, or cost UI was used. |
3. Environment
- Public repository
get-bb/bb; main commit7f5d39cdd88ca4ab4fcaaab7236bea14466c1d67, fetched from the canonical repository. - Linux x64, Node.js 22.19.0, pnpm 9.15.0, Vitest 4.1.1, ACP SDK 1.7.0.
- Real ACP bridge and assembler, using the repository's subprocess fake ACP agent with an investigation-authored usage fixture.
- Two separate checkouts and separate dependency installs. The test harness creates and removes a fresh temporary workspace in each run. No development server, fixed ports, persistent product data directory, provider credentials, or database is needed.
4. Minimal reproduction
- Use a clean checkout of the recorded main commit. Run
pnpm install --frozen-lockfile --prefer-offline. The normalpnpm exec turbo run buildwas attempted in both checkouts; it failed in the unrelated GitHub plugin because SDK host/process runtime entries were not yet built. This does not block the package-level reproduction, whose Turbo dependencies build successfully. - In
packages/provider-bridge-acp/src/bridge/fake-acp-agent.mjs, add the following spread inside the final prompt response'sresultobject, immediately afterstopReason. This changes test support only, not the production bridge:...(process.env.FAKE_ACP_PROMPT_USAGE === "1" ? { usage: { inputTokens: 120, outputTokens: 12, totalTokens: 132, thoughtTokens: 3, cachedReadTokens: 30, cachedWriteTokens: 40, }, } : {}), - Inside the existing
describe("acp bridge")inpackages/provider-bridge-acp/src/bridge/bridge.test.ts, add this regression using the existing helpers. The existingend-silentlyfixture sends a context notification before resolving the prompt:it("forwards ACP prompt result usage to thread token events", async () => { const { bbThreadId, providerThreadId } = await startThread({ envVars: { FAKE_ACP_PROMPT_USAGE: "1" }, }); await completeTurnWith( providerThreadId, "end-silently", executionOptions({}), ); expect(contextWindowDeltasFor(bbThreadId)).toEqual([ { used: 100, size: 1000 }, ]); expect(threadEventsOfType("turn/completed")).toHaveLength(1); expect(threadEventsOfType("thread/tokenUsage/updated")).toHaveLength(1); }); - From the repository root, run:
pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/bridge/bridge.test.ts -t 'forwards ACP prompt result usage to thread token events'
Expected: the prompt completes, context usage is present, and one token-usage event is emitted. Actual: the first two checks pass; only the token-event assertion fails. Verbatim assertion and test summary:AssertionError: expected [] to have a length of 1 but got +0 Test Files 1 failed (1) Tests 1 failed | 207 skipped (208)
This test deliberately does not choose a cache-normalization or accumulation policy: even a single usage-bearing prompt produces no token event. The fixture does not simulate bridge output; it serves an ACP response over the same subprocess transport as the existing integration tests.
5. Root cause
The bridge uses its own prompt-result schema, not the SDK response schema. It types only stopReason and passes through everything else without a typed usage contract:
export const acpPromptResultSchema = z
.object({
stopReason: acpStopReasonSchema,
})
.passthrough();
After a normal prompt resolves, the only usage-related action is grokContextUsageFromPromptResult(result). The compaction path has the same omission. The Grok helper reads _meta, not top-level usage.
Separately, usage_update translation emits context-window deltas, including optional cost, not token-count deltas. The shared assembler already knows how to produce token events when a kind: "usage" delta arrives. The missing producer is inside ACP, not in that assembler or the UI.
6. Proposed fix and safety decision
Validate optional prompt usage at the ACP boundary and translate accepted samples into the existing usage-delta contract, including both ordinary prompts and compaction. Retain context-window size and define how totals survive resume, session replacement, and cancellation. Missing or malformed optional usage must not break an otherwise valid prompt.
No automatic fix or PR: the “no product or architecture decision” simple-fix condition is not satisfied. The pinned SDK's generated types.gen.d.ts describes PromptResponse.usage as turn usage, but Usage.inputTokens and Usage.outputTokens as totals across all turns. Blindly summing cumulative samples double-counts, while treating per-turn samples as cumulative loses usage. Cache-inclusive versus cache-exclusive counters also need a defined dialect policy before subtraction is safe. The repository's AcpDialect does not currently define these accounting semantics.
The next bounded experiment is to capture two successive prompt responses from an approved test provider, plus cache-hit and session-resume cases, and resolve the counter contract before implementing the mapper. The dropped event itself is high-confidence; the correct monetary and cumulative mapping is not established by this reproduction.
No open PR was linked by the issue timeline or found by the issue-number PR search at investigation time. No production source was changed, committed, or pushed. The local reproduction changes two test-support files, 30 added text lines, no deletions, and no binary changes; git diff --check passes. There is no fixed-code passing-test claim.
7. Related issues
#2397 is the broader ACP usage/capability request (classified Feature). #3941 is closed and concerns context-usage cost forwarding; that cost path exists on the tested main and is separate from missing token deltas.
8. Verification
The same agent repeated the reproduction, not an independent reviewer. A second detached worktree was created at the full recorded commit. Its tracked files were unchanged before adding exactly the same two test-support edits. It received its own frozen dependency install, normal build attempt, fresh test workspace, and fresh fake-agent process.
The identical Turbo command from section 4 failed at the identical token-event assertion: expected one event, received zero. First run: 23:18 UTC; second run: 23:20 UTC, November 3, 2026. Both runs reached prompt completion and forwarded the context notification. No production-code patch was present in either run. The second run required no change to the finding.
Existing nearby controls were also run:
pnpm exec turbo run test --filter=@bb/provider-bridge-acp -- src/bridge/bridge.test.ts -t 'surfaces Grok context window|ignores Grok-shaped|forwards context usage reported'
Test Files 1 passed (1)
Tests 3 passed | 205 skipped (208)
Root-cause permalinks were checked against git show at the recorded commit. No screenshots are needed for this nonvisual transport defect. Test code and assertion output are inline; raw execution logs and the reproduction diff remain outside the public reports repository, per its publication rules.
9. Appendix and limits
Read-only GitHub checks covered repository visibility, all issue comments (none), classification values, related issue metadata, and linked/open PR metadata (none). Trusted-main source inspection covered prompt decoding, prompt completion, compaction, dialect context extraction, notification translation, and shared usage-event assembly. The dependency's installed schema and generated type descriptions were inspected locally. No external issue link was fetched and no third-party code or user session data was executed.
Build setup commands in each checkout were pnpm install --frozen-lockfile --prefer-offline and pnpm exec turbo run build. A first-checkout pnpm exec turbo run build:types --filter=@get-bb/plugin-sdk succeeded while inspecting the unrelated build setup; neither reproduction relies on the full workspace build. Reproduction commands and exact expected/actual output are in sections 4 and 8. A code-format pass and git diff --check were performed on the authored regression; no production fix was attempted.
Issue content was treated only as untrusted claims. No issue instructions, scripts, external provider installation, patches, linked branches, or account access were used. The report intentionally does not establish Copilot's multi-turn semantics, Burn pricing, monetary costs, or a generic cache policy.