Skip to content

feat(desktop): per-turn usage pill in the status bar#3127

Open
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:feat/usage-stats
Open

feat(desktop): per-turn usage pill in the status bar#3127
HUQIANTAO wants to merge 1 commit into
esengine:main-v2from
HUQIANTAO:feat/usage-stats

Conversation

@HUQIANTAO
Copy link
Copy Markdown
Contributor

The status bar showed session-aggregate cache-hit % and the running turn's wall-clock + token count, but the actual per-turn prompt/completion/cache numbers were only visible by digging into the WireUsage payload in devtools. For a cost-aware user the billable numbers deserve a permanent place.

Add components/UsageIndicator.tsx: a 3-cell pill that mounts in the status bar:

↑ 1.2k prompt tokens this turn
↓ 280 completion tokens this turn
↻ 850 cache-hit tokens (only rendered when > 0)

The values are k-rounded to keep the bar compact. The cache cell uses --add-fg so the green cue matches the rest of the UI.

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 4, 2026
…tion ↻cache)

The status bar showed session-aggregate cache-hit % and the
running turn's wall-clock + token count, but the actual per-turn
prompt/completion/cache numbers were only visible by digging
into the WireUsage payload in devtools. For a cost-aware user
(especially on DeepSeek where cache hits are 90% cheaper than
misses) the billable numbers deserve a permanent place.

Add components/UsageIndicator.tsx: a 3-cell pill that mounts in
the status bar to the right of the cache-hit %. Each cell is a
tiny caption + value pair:

  ↑ 1.2k   prompt tokens this turn
  ↓  280   completion tokens this turn
  ↻  850   cache-hit tokens (only rendered when > 0)

The values are k-rounded (1.2k / 18k / 0) to keep the bar
compact. The cache cell uses the existing --add-fg token so the
green cue matches the rest of the UI.

A real sparkline (per-turn history) needs a separate ring buffer
in the controller — the WireUsage payload only carries the latest
turn. That's a follow-up; the pill is the immediate win and the
sparkline is a drop-in upgrade.

StatusBar.tsx mounts the pill when usage is present (the
controller dispatches a usage event on every model step, so the
pill ticks as the turn progresses).
@HUQIANTAO HUQIANTAO requested a review from SivanCola as a code owner June 4, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant