Skip to content

Releases

v0.3.0

Choose a tag to compare

@jashjacob jashjacob released this 16 Nov 12:44
164f913

opencode-token-metrics v0.3.0

One package for OpenCode V1 and V2.

V2

  • The same package loads in the OpenCode 2 TUI and renders in the prompt footer.
  • Add "opencode-token-metrics" to plugins in opencode.json. Options go in ~/.config/opencode/cli.json.
  • A tool loop keeps one graph across steps, then freezes on the execution's summed tokens.
  • Compaction is its own generation and does not leak the previous turn's totals.

V1

Install is unchanged:

opencode plugin opencode-token-metrics -g

The server entry now loads as an empty hook, so that installer does not error on startup.

Metrics

  • Prompt-cache hit rate on the frozen line (cache 87%). It is omitted when the provider reports no prompt tokens. showCache defaults to true.

Verification

  • 118 tests, typecheck, and the packed-package smoke test.
  • CI passed on Node 20 and 22.

v0.2.0

Choose a tag to compare

@jashjacob jashjacob released this 18 Sep 06:12

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 ci runs the same checks locally.

v0.1.0

Choose a tag to compare

@jashjacob jashjacob released this 17 Sep 16:19

Initial release. Live VU-style tokens-per-second meter for the OpenCode TUI prompt, with a held final frame, average, peak, trend, and time-to-first-token. Zero runtime dependencies.