Skip to content

feat(tui): show live token speed in status bar - #47921

Closed
phpoh wants to merge 1 commit into
anomalyco:devfrom
phpoh:token-speed
Closed

phpoh wants to merge 1 commit into
anomalyco:devfrom
phpoh:token-speed

Conversation

@phpoh

@phpoh phpoh commented Sep 8, 2026

Copy link
Copy Markdown

Closes #47914

Shows real-time token generation speed in the TUI prompt status bar, Hermes-style (15.2 t/s).

  • While streaming: rolling estimate from streamed text (chars / 4 per token) over elapsed turn time, refreshed every 500ms next to the esc interrupt hint. Exact counts only materialize at step-finish, so live values are estimates by design.
  • After the turn completes: exact per-response average from tokens.output / (completed - created), appended to the existing usage line (12.3K (42%) · $0.12 · 48.0 t/s).
  • New pure helpers in packages/tui/src/util/tps.ts with unit tests (estimateOutputTokens, calcTps, formatTps).

Verification:

  • bun typecheck in packages/tui: clean.
  • bun test in packages/tui: 197 pass, 1 pre-existing Windows-only failure in test/runtime.test.tsx (path separator, fails on clean tree too).

Follow-ups (not in scope): subagent footer parity, --mini run footer, session-wide average, display.show_output_speed toggle if maintainers want it opt-in.

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my search, I found several related PRs that might be worth reviewing for context or overlap:

Potentially Related PRs:

  1. PR feat(tui): show tokens per second in the response footer #46108: feat(tui): show tokens per second in the response footer

  2. PR feat(tui): show token throughput #42112: feat(tui): show token throughput

  3. PR fix(core): make usage statistics fast and responsive #47527: fix(core): make usage statistics fast and responsive

These PRs touch on similar token speed/throughput display features. You should review PR #46108 and #42112 particularly closely to ensure your implementation in the status bar doesn't duplicate or conflict with footer-based approaches, and to confirm the calculation methodology aligns.

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new pull request that follows our guidelines.

@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label Sep 8, 2026
@github-actions github-actions Bot closed this Sep 8, 2026
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.

[FEATURE]: Real-time token generation speed (tok/s) in TUI status bar, like Hermes

1 participant