opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat: display tokens per second for assistant messages

Open edlsh opened this issue 1 week ago • 2 comments

Summary

Implements tokens/second display for assistant messages per #5374.

Changes

  • Track firstToken timestamp when streaming begins
  • Display tok/s rate next to response duration (only for completed text responses)
  • Minimum 250ms elapsed time threshold to avoid noisy metrics
  • Accumulate tokens instead of overwriting for multi-part responses
  • Comprehensive test coverage for token utilities

Notes

If styling is not the direction the team wants to take, I'm happy to make revisions or move the display to a different location.

Closes #5374

edlsh avatar Dec 14 '25 00:12 edlsh

CleanShot 2025-12-13 at 19 17 28

edlsh avatar Dec 14 '25 00:12 edlsh