Skip to content

feat(tui): label context, cache, and generated tokens in the wide status line - #238

Merged
Max17190 merged 2 commits into
tui-transcript-escape-hatchesfrom
tui-statusline-cache-tokens
Aug 27, 2026
Merged

feat(tui): label context, cache, and generated tokens in the wide status line#238
Max17190 merged 2 commits into
tui-transcript-escape-hatchesfrom
tui-statusline-cache-tokens

Conversation

@Max17190

@Max17190 Max17190 commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Why

Cache hit rate and generation volume exist only behind /context and /status, so the costs the harness treats as design stay invisible while working.

Summary

At 100 columns and up the status line reads model ctx N% cache M% out 16.8k approvals: labeled, because two bare percents are indistinguishable. Generated tokens sum completion tokens only; prompt tokens are deliberately not summed, since every request resends the history and their sum would measure resending, not work. Narrower tiers keep their historical shapes; the meter resets with /new.

Test Plan

  • compact_counts_read_like_a_human_wrote_them (842 / 1k / 16.8k / 17k / 2.4M).
  • wide_status_line_labels_context_cache_and_generated_tokens (labels, accumulation across usage reports, and the 78-column tier unchanged), shown red with the wide tier disabled.
  • Workspace tests and clippy clean.

Greptile Summary

The wide TUI status line now shows labeled context, cache, and generated-token metrics while preserving the approval mode when model identifiers are unusually long. The generated-token meter counts completion output for the current app run and clears when a new session begins.

Confidence Score: 5/5

No blocking failure remains; the rendered wide status line retains its essential tail under a long model identifier.

No accepted blocking findings remain.

T-Rex T-Rex Logs

What T-Rex did

  • Compared the 100-column status row rendering before and after the PR fix, noting that before the change the row ended at out 12 and after the change it displayed ctx 50% cache 93% out 12.5k while clipping the model identifier.
  • Ran the dedicated regression test and confirmed it passed, demonstrating that the status tail remains visible.
  • Reviewed the code paths that build and clip the status tail, including the width-based selection and the tail construction logic that preserves the long-model tail.

View all artifacts

T-Rex Ran code and verified through T-Rex

Reviews (4): Last reviewed commit: "fix(tui): the wide status tail survives ..." | Re-trigger Greptile

@Max17190
Max17190 marked this pull request as ready for review August 27, 2026 03:53
@Max17190
Max17190 force-pushed the tui-statusline-cache-tokens branch from 3470359 to c7dfb30 Compare August 27, 2026 03:55
Comment thread crates/tui/src/app.rs Outdated
@Max17190
Max17190 force-pushed the tui-statusline-cache-tokens branch 2 times, most recently from 5750947 to 47e652b Compare August 27, 2026 05:19
…tus line

Cache hit rate and generation volume existed only behind /context and
/status, so the costs the harness treats as design stayed invisible
while working. At 100 columns and up the status line now reads
'model  ctx N%  cache M%  out 16.8k  approvals': labeled, because two
bare percents are indistinguishable. Generated tokens sum completion
tokens only; prompt tokens are deliberately not summed, since every
request resends the history and their sum would measure resending, not
work. Narrower tiers keep their historical shapes.
The wide tier rendered the full model id and let the row clip whatever
followed, so a long id ate ctx, cache, out, and the approval mode. The
tail is built first and the model id is clipped to the width it leaves
over; short ids keep the tier's historical shape byte for byte.
@Max17190
Max17190 force-pushed the tui-statusline-cache-tokens branch from 47e652b to af28d94 Compare August 27, 2026 08:01
@Max17190
Max17190 merged commit 7728ca4 into main Aug 27, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant