Skip to content

v0.3.0

Latest

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.