Repository navigation
Releases
v1.4.0 — accurate AVG, idle-stop scheduler, per-cell particles
Rolls up the v1.3.x line into one stable release. No code changes since v1.3.2.
Measurement
- AVG / live TPS are no longer inflated by tool calls. Streaming of tool-call arguments now counts toward live TPS and the AVG generation window. Steps that made tool calls without streamed arguments are left out of AVG and calibration.
- Reasoning tokens are only counted when the reasoning was actually streamed.
- The spinner stops after an interrupt or error.
- A completion only clears the live state of the message that is currently streaming.
Performance and display
- No timers and no re-renders while idle. Updates are throttled and only re-render when the text changes.
- The meter is a single text node: the idle line is exactly
TPS -- | AVG -- | TTFT --, and the thinking stream has a per-cell color gradient again. - Writing to a destroyed view can no longer throw.
opencode 2.x
- The meter follows session switches, and the slot is unregistered on dispose.
Options
spinner.intervalMsis clamped to 40–1000 andspinner.cellsto 2–16. Invalid colors and invalid tiers fall back to the defaults.
Engineering
- 67 unit tests, plus a sync test for the measurement region shared by
measure.tsandtui.tsx. - CI and Publish run
tscandnpm run smoke-install. npm auditreports 0 for the repo.- Added a LICENSE file (MIT).
Notes
- The peer dependencies stay required. v1.3.1 tried making them optional to slim the install, and the meter stopped loading on opencode 1.x (fixed in v1.3.2). The install is therefore still about 126 MB, and the Dependabot runtime alerts come from opencode's own packages.
Updating
Run npm cache clean --force, delete ~/.cache/opencode/packages/@jack-yang/opencode-tps-meter@latest, then run opencode plugin @jack-yang/opencode-tps-meter -g -f and restart opencode.
v1.3.2 — fix: meter missing on opencode 1.x (revert optional peers)
Fix: the meter did not appear with v1.3.1
v1.3.1 made the @opentui/*, solid-js and @opencode-ai/plugin peer dependencies optional to slim the install. On opencode 1.x (tested on 1.19.5), the plugin then failed to load and the meter disappeared. This release reverts that change: the peers are installed again.
Everything else from v1.3.1 stays: the dev tree's security overrides and vitest 4 upgrade (npm audit: 0), and the npm run smoke-install check in CI/Publish, which now asserts the required peers are installed.
No change to the plugin code (tui.tsx).
Updating
Run npm cache clean --force, delete ~/.cache/opencode/packages/@jack-yang/opencode-tps-meter@latest, then run opencode plugin @jack-yang/opencode-tps-meter -g -f and restart opencode.
v1.3.1 — optional peers: ~46 KB install, no vulnerable deps
Superseded by v1.3.2. This release made the peer dependencies optional, which broke loading on opencode 1.x (the meter did not appear). Use v1.3.2.
v1.3.0 — accurate AVG, idle-stop, per-cell particle colors
Fixes
- AVG / live TPS no longer inflated by tool calls. Tool-call argument streaming now counts toward live TPS and the AVG generation window. Steps that made tool calls without streamed arguments (older opencode) are excluded from AVG/calibration instead of being counted as "N tokens in 1s".
- Non-streamed reasoning is not counted (models that report reasoning tokens without streaming them).
- Spinner no longer gets stuck after an interrupt or error (
session.idle/session.error, V2session.execution.*, plus a stale fallback). - A completion only clears the live state of the message that is actually streaming.
- Writing to a destroyed renderable can no longer throw; one failing view doesn't break the others.
- opencode 2.x: the meter follows session switches, and the slot is unregistered on dispose.
Performance
- No timers and no re-renders while idle. Updates are throttled (≤10 Hz, or the spinner interval while thinking) and only re-render when the text actually changes.
Display
- Single text node: the idle line is exactly
TPS -- | AVG -- | TTFT --with no trailing gap. Per-cell gradient in the thinking stream is back.
Options
spinner.intervalMsis clamped to 40–1000 andspinner.cellsto 2–16. Invalid hex colors and non-ascending tiers fall back to the defaults.
Engineering
- Pure measurement logic is shared between
measure.tsandtui.tsx, with a sync test enforcing it (67 tests). CI now runstsc. The manual Publish trigger was removed. Added a LICENSE file (MIT).
Updating
opencode 1.x: delete ~/.cache/opencode/packages/@jack-yang/opencode-tps-meter@latest, run opencode plugin @jack-yang/opencode-tps-meter -g -f, then restart opencode.
v1.2.0 — OpenCode 2.x support (one package, both versions)
Added
- OpenCode 2.x support — one package now loads on both opencode 1.x and 2.x. The default export carries two entrypoints:
tui(V1) andsetup(V2, new plugin API). The measurement core (TPS / AVG / TTFT / thinking stream) is shared and unchanged.
How it works on 2.x
- Events:
session.text.delta/session.reasoning.delta(streaming TPS),session.step.started(TTFT origin),session.step.ended(AVG + calibration),session.step.failed/session.tool.input.started(clear live state). - Render:
ctx.ui.slot({ append: "prompt.footer.status" })— V1'ssession_prompt_rightslot no longer exists in V2. Override with the newslotoption if placement needs adjusting. - Theme: V2 semantic tokens (
text.muted,text.feedback.*.base,hue.accent[500]). - No new dependencies: V2 API types are declared locally; nothing is imported from
@opencode/pluginat runtime.
Install
# opencode 1.x (unchanged)
opencode plugin @jack-yang/opencode-tps-meter -g
# opencode 2.x
opencode plugin add @jack-yang/opencode-tps-meterOn 2.x, terminal-client plugin config lives in ~/.config/opencode/cli.json under plugins (your tui.json is migrated automatically). Options are the same as before; 2.x uses the object form:
{
"plugins": [
{
"package": "@jack-yang/opencode-tps-meter",
"options": { "spinner": { "theme": "tech", "cells": 6 } }
}
]
}Feedback wanted (2.x)
The V2 adapter is verified against the published 2.x type definitions but not yet against a running V2 binary. If the meter shows in an unexpected spot, set the slot option (e.g. "prompt.footer", "session.composer.top") and please open an issue with a screenshot.
opencode 1.x behavior is unchanged (tested on 1.17.20 / 1.18.30).
v1.1.2 — fix install failure on opencode >=1.18 (ERESOLVE)
Fixed
- Plugin could not be installed on opencode >= 1.18 —
opencode plugin add @jack-yang/opencode-tps-meterfailed withunable to resolve dependency tree(npm ERESOLVE).
Why
Newer @opencode-ai/plugin pulls @opentui/core 0.5.x, but this package's peer range ^0.4.2 capped it below 0.5. opencode's installer uses npm's strict arborist resolver, so the tree became unresolvable. (bun only warns on peer conflicts, which is why local testing didn't catch it.)
Change
Widen peer ranges (metadata only, no code change):
@opentui/core:^0.4.2→>=0.4.2 <1@opentui/solid:^0.4.2→>=0.4.2 <1
Reinstall
opencode plugin @jack-yang/opencode-tps-meter -g -fIf it still fails with unable to resolve dependency tree right after this release, your local npm cache (~/.npm) still holds the pre-1.1.2 metadata. Refresh it once:
npm cache clean --forcev1.1.1 — Switch to Trusted Publishing
Pipeline change only. Switch from NPM_TOKEN to npm Trusted Publishing (OIDC). No code changes.
v1.1.0 — maintenance & security
- Security: override brace-expansion ^5.0.8 (DoS vuln)
- Docs: npm/license/stars badges now clickable
- Bundles all v1.0.x fixes: npm dual solid-js instance (v1.0.1), idle blank-space reservation (v1.0.2)
- Released via GitHub Release → auto-publish flow
v1.0.2
Fix: single text node for the thinking particle stream — no blank space reserved when idle (multiple empty cells reserved width). Also fixes the npm dual solid-js instance issue from v1.0.0 (reactive replaced with imperative updates).
v0.1.0
Initial release
- Live TPS with color-coded speed tiers (red/yellow/green/cyan)
- Session-wide cumulative AVG from completed messages
- TTFT shown immediately on first token
- Token calibration from actual token counts
- Wall-clock duration to avoid burst inflation