Repository navigation
v0.2.0
opencode-token-metrics v0.2.0
Install: opencode plugin opencode-token-metrics -g
Metrics
- Average is now active generation speed — sums only the spans where tokens were actually streaming, so tool calls no longer drag it down.
- Exact-total scaling — on completion the frozen graph, peak bucket, and peak rate are rescaled to the provider's reported token count.
Graph
- Fragmentation-invariant counting — token totals are independent of how the stream is chunked.
- Low columns render as short bars instead of blanks (no phantom gaps).
- Stable scaling to the turn's busiest second (no rescale when the peak scrolls out of view).
- The graph stays continuous across tool calls and pauses.
Verification
- 78 unit/integration tests, typecheck, packed-package smoke test, and pack dry-run.
- CI on Node 20 and 22;
npm run ciruns the same checks locally.