Skip to content

feat(tui): show session tokens and cache rate in the footer - #364

Merged
github-actions[bot] merged 2 commits into
mainfrom
feat/footer-usage-slot
Aug 16, 2026
Merged

github-actions[bot] merged 2 commits into
mainfrom
feat/footer-usage-slot

Conversation

@mohitranka

Copy link
Copy Markdown
Contributor

Summary

  • Replace the footer’s reserved ⚑ / N changes slot with session token usage and cache hit rate.
  • Keep lifecycle + context bar. Last segment is always 12.4k · 81% cache, or 0 · — until the provider reports prompt tokens.
  • Total is API prompt + completion. Rate is cache_read / prompt_tokens.
  • Snapshot carries prompt_tokens / completion_tokens so the footer does not walk the transcript each frame.

Why

The right-hand slot was an inert flag, or a change count that hid anything else the moment the tree was dirty. Session spend and cache already exist on SessionTokenUsage but only showed up in /status and on exit.

Test plan

  • cargo test --package forge-tui --lib --locked -- footer activity theme::light_theme
  • cargo test --package forge-session --lib --locked -- snapshot
  • cargo clippy --package forge-tui --package forge-session --all-targets --locked -- -D warnings

Replace the unused footer flag / change-count slot with session API
totals and a prompt-cache hit rate. Keep the context bar. Show
`0 · —` until the provider reports prompt tokens.
@github-actions
github-actions Bot enabled auto-merge (squash) August 16, 2026 15:38
The usage slot is wider than the old flag, so the 60-col fixture
middle-truncates `mymodel` past the old `odel` substring.
@github-actions
github-actions Bot merged commit 5a65239 into main Aug 16, 2026
7 checks passed
mohitranka added a commit that referenced this pull request Aug 21, 2026
* feat(tui): show session tokens and cache rate in the footer

Replace the unused footer flag / change-count slot with session API
totals and a prompt-cache hit rate. Keep the context bar. Show
`0 · —` until the provider reports prompt tokens.

* test(tui): accept a shorter model tail on the narrow footer

The usage slot is wider than the old flag, so the 60-col fixture
middle-truncates `mymodel` past the old `odel` substring.
mohitranka added a commit that referenced this pull request Sep 11, 2026
* feat(tui): show session tokens and cache rate in the footer

Replace the unused footer flag / change-count slot with session API
totals and a prompt-cache hit rate. Keep the context bar. Show
`0 · —` until the provider reports prompt tokens.

* test(tui): accept a shorter model tail on the narrow footer

The usage slot is wider than the old flag, so the 60-col fixture
middle-truncates `mymodel` past the old `odel` substring.
mohitranka added a commit that referenced this pull request Sep 11, 2026
* feat(tui): show session tokens and cache rate in the footer

Replace the unused footer flag / change-count slot with session API
totals and a prompt-cache hit rate. Keep the context bar. Show
`0 · —` until the provider reports prompt tokens.

* test(tui): accept a shorter model tail on the narrow footer

The usage slot is wider than the old flag, so the 60-col fixture
middle-truncates `mymodel` past the old `odel` substring.
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