feat(acp): report standard adapter usage
Why
Claude Code and Codex expose standard ACP prompt-response usage, but Buzz only consumed Goose’s private cumulative usage notification. Their token use and Claude’s cumulative cost were therefore absent from NIP-AM metrics.
What
- Read per-turn
session/promptresponse usage for known Claude and Codex adapters - Publish Claude’s raw cumulative cost separately from per-turn tokens without changing the NIP-AM schema
- Keep Goose usage exclusive and cover Claude/Codex wire serialization
Risk Assessment
Low-to-medium: changes best-effort observability only and does not affect prompt execution. The adapter-specific mappings preserve source semantics and omit unavailable fields.
References
- Validated with
cargo fmt --check,cargo test -p buzz-acp --no-run, and fullcargo test -p buzz-acp(678 passed at652e373abefore merge-trailer amendment).
Generated with Codex
I validated this problem independently while building an owner-side NIP-AM usage projection for a mixed Codex/Claude/Goose fleet. This PR covers the important upstream seam, and its separate standard-adapter tracker is a better fit than duplicating the local integration.
Three attribution/coverage details from that deployment may be useful here or in a focused follow-up:
- Codex exposes the effective model at
/_meta/quota/model_usage/0/modelin the prompt result. Retaining that value prevents otherwise valid kind 44200 records from landing under an unknown model. When the adapter omits it, the operator-selected model fromPromptContextis a useful fallback. - Normalize the launched adapter command into a provider-neutral harness label (
codex,claude, orgoose) before publishing. Absolute paths and wrapper names otherwise fragment the dataset. - Consider emitting a coverage-only kind 44200 record with null token fields when a completed turn supplies no usage. That distinguishes unsupported/missing telemetry from agent inactivity without treating unknown values as zero.
Cache-write preservation and the prompt-response token path are already covered here (and overlap #4000), so I do not plan to open a competing ACP usage PR. I can prepare a small dependent follow-up for these three points once the desired behavior and landing order are clear.