Skip to content

feat(tui): add average TPS to status bar#22345

Closed
KonstantinMirin wants to merge 1 commit intoanomalyco:devfrom
KonstantinMirin:feat/tui-tps-status
Closed

feat(tui): add average TPS to status bar#22345
KonstantinMirin wants to merge 1 commit intoanomalyco:devfrom
KonstantinMirin:feat/tui-tps-status

Conversation

@KonstantinMirin
Copy link
Copy Markdown

Issue for this PR

Closes #22344

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds average output tokens-per-second (TPS) to the TUI status bar, displayed before context size after a response completes. The metric is computed from data already on AssistantMessage: tokens.output / ((time.completed - time.created) / 1000).

Shows up as "42 t/s · 1.2K (12%) · $0.05" in:

  • Prompt footer
  • Subagent footer
  • Sidebar context plugin

TPS only appears on completed messages (requires time.completed), so it won't show mid-stream or for incomplete responses.

How did you verify your code works?

  • bun typecheck passes across all packages
  • Manually tested in TUI: TPS appears alongside context/cost after a response completes

Screenshots / recordings

N/A — TUI text change

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions
Copy link
Copy Markdown
Contributor

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

I found several related PRs that may be duplicates or closely related to PR #22345:

  1. PR feat(tui): show tokens per second in the footer and sidebar  #21133 - "feat(tui): show tokens per second in the footer and sidebar"

    • This appears highly related as it also adds TPS display to TUI footer and sidebar
  2. PR feat(tui): show tokens per second in assistant message footer #14493 - "feat(tui): show tokens per second in assistant message footer"

    • Similar feature focused on displaying TPS in the assistant message footer
  3. PR feat(tui): add tokens per second to response footer #12721 - "feat(tui): add tokens per second to response footer"

    • Related feature adding tokens per second metrics to response footer
  4. PR feat(tui): add native status line template system #13885 - "feat(tui): add native status line template system"

    • May be related as it deals with status bar/line customization

These PRs should be reviewed to determine if they're addressing the same feature or if there's overlap in implementation. PR #21133 seems particularly relevant given the matching scope (footer, sidebar, TPS display).

@KonstantinMirin
Copy link
Copy Markdown
Author

Closing in favor of #21133 which already implements TPS display with live streaming support via message.part.delta events, a proper tps.ts utility, and Locale.tokensPerSec. This PR only added post-completion average TPS which is a subset of what #21133 provides.

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]: Show average TPS in TUI status bar

1 participant