Repository navigation
Description
Summary
The standard ACP surface carries no token-consumption field, so ACP threads produce no thread/tokenUsage/updated events. Nothing expresses that, so downstream an unmeasured turn looks the same as a turn that used nothing.
To be clear about what this is not: the bridge is not dropping anything. On main (42d2c1b), ACP's only usage message is
// packages/provider-bridge-acp/src/wire.ts:246-253
acpUsageUpdateSchema = { sessionUpdate: "usage_update", used, size } // .passthrough()— context-window occupancy — and delta-translation.ts:970-983 maps it to { kind: "contextWindow", used, size, estimated: false }. That mapping looks correct. There is simply no token data on the standard surface to forward.
Observation
From bb.db on one host:
SELECT t.provider_id,
count(DISTINCT t.id) AS threads,
sum(CASE WHEN e.type LIKE '%turn/completed' THEN 1 ELSE 0 END) AS completed_turns,
sum(CASE WHEN e.type = 'thread/tokenUsage/updated' THEN 1 ELSE 0 END) AS usage_events
FROM events e JOIN threads t ON t.id = e.thread_id
GROUP BY t.provider_id ORDER BY completed_turns DESC;| provider | threads | completed turns | tokenUsage/updated |
|---|---|---|---|
| claude-code | 62 | 1932 | 96 |
| codex | 153 | 570 | 368 |
| acp-opencode | 124 | 307 | 0 |
| acp-hermes-agent | 38 | 305 | 0 |
Scope of that data, so it isn't read as more than it is: both ACP providers are locally-registered agents rather than anything bb ships, and both run through the same bridge and translation path — so the zeros follow from the schema above rather than from two independent agents. The non-ACP rows are not 1:1 either (claude-code shows 1932 completions against 96 usage events), so no per-turn denominator should be read from this table. The distinct threads reporting a context window are 106 (acp-opencode) and 38 (acp-hermes-agent), so these threads are observed — only their cost is absent.
Why it's awkward downstream
A consumer can detect the absence by joining on events, as the query above does. The cost falls on consumers that instead collapse a missing report to a numeric zero, which is easy to write when the providers you integrate against first all report. That happened in a plugin I maintain: its usage columns are NOT NULL DEFAULT 0, so every ACP row reads as a measured zero and share-style metrics return a confident 0% for ACP threads.
That coercion is mine, not bb's. The general point is only that nothing in the event stream states "this turn produced no report", so correct handling depends on a consumer knowing to look for an absence.
Possible improvement
Optional capability metadata on the provider descriptor:
reportsTokenUsage?: boolean; // absent = unknown; false = known not toAbsence should mean unknown rather than true — existing and third-party descriptors omit the field, and reading those as capable would assert something unestablished.
A capability rather than a per-turn marker because dialect.ts already lets a vendor stamp _meta side channels and acpUsageUpdateSchema is .passthrough(), so an agent could carry token data without a protocol change. A dialect that does surface tokens sets true; the generic ACP dialect sets false. That way the signal improves as vendors improve instead of hard-coding a limitation, and a consumer decides once per provider.
Its limit, stated plainly: a capability describes what a provider can do, not whether a given turn was measured. If those diverge within a provider it can't express that — I have no evidence they do.
Tests it would need: descriptor parse/serialize round-trip with the field present and absent, and a legacy descriptor with no field staying unknown rather than coerced.
Activity
[-]ACP providers emit no thread/tokenUsage/updated, so there is no positive signal that a turn produced no usage report[/-][+]ACP has no token-usage field, and no way to express that a provider cannot report usage[/+]patch: providers declare whether they report token usage (get-bb#2397)
patch: providers declare whether they report token usage (get-bb#2397)
patch: pin reportsTokenUsage in the first-party provider info test
feat(turn-stats): per-turn token, cost, and throughput stats across p…
feat(turn-stats): Devin ACP tap — real per-turn tokens, tok/s, and TTFT
patch: providers declare whether they report token usage (get-bb#2397)
patch: pin reportsTokenUsage in the first-party provider info test
jjanousek commentedon Sep 17, 2026
One provider-specific correction to "there is simply no token data on the standard surface to forward", offered because it changes what the fix should be for at least one ACP agent.
cursor-agentdoes report token usage. bb just launches it in a mode that cannot carry it.Run in its
--printmode, itsresultevent carries full usage. Measured on bb 0.43.0 withcursor-agent2026.09.15, one trivial turn:Event types emitted in that mode:
system,user,thinking,assistant,result.bb does not use that mode. From
pson this host, every Cursor worker is launched as:So the number exists inside the process for every turn and is never asked for. The issue's analysis of the ACP surface looks right to me and I am not disputing it:
usage_updatecarries context-window occupancy and nothing else, and the bridge forwards what it is given. The part I would amend is the conclusion drawn from it.Why the distinction matters for the fix. The issue proposes a way to express that a provider cannot report usage. For
cursor-agentthat would record something untrue, and it would be recorded permanently: the honest statement is "this provider can report usage, and the ACP transport bb selects does not carry it". Those want different remedies — the first is a UI affordance, the second is either an ACP extension or a per-agent capability that says where the number can be fetched instead.I have no view on which is right for ACP generally, and other agents may genuinely have nothing to report. Just flagging that "cannot report" is the wrong label for at least this one, and it is cheap to check per agent before the label is applied.
Happy to test a patch against this install.
albrand commentedon Sep 17, 2026
Thanks @jjanousek, that's a useful correction, and it catches a real mistake in the change I'd already made.
I've been running the capability from the issue in my fork. It's in albrand/bb@6efa5c3:
backend-contract.tsaddsreportsTokenUsage?: booleanto the provider capabilities. Leaving it out means unknown. It never meanstrue.host-policy.tschecks that the field is a boolean. It passes the field through only when it's set, so an older descriptor stays unknown and isn't turned into a value.claude-codeandcodexdeclaretrue.Your point applies directly to how the fork handles ACP.
plugins/provider-acp/src/declaration.tssetsreportsTokenUsage: falseonce for every ACP agent, andagents.test.tschecks that value for every entry inKNOWN_ACP_AGENTS.acp-cursoris one of those entries. So the fork currently says "cannot report" about Cursor, which is the untrue, permanent label you described.I agree with the distinction. The capability can say what bb's integration receives, but it shouldn't be one value for all of ACP. I'd change it in two ways:
cursor-agentper your measurement, should be left unset (unknown) rather thanfalse. Only an agent that we've checked and found has nothing to report should getfalse.result.usagefrom--print --output-format stream-json) or add an ACP_metaextension. That work is separate, and I haven't scoped it here.I'll change the fork's ACP declaration to per-agent and remove the test that requires
falsefor every agent. If a PR follows, I'd take you up on the offer to test it against your Cursor install.