[PR #5497] feat: display tokens per second for assistant messages #11431

Open
opened 2026-02-16 18:16:16 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/5497

State: open
Merged: No


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

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/5497 **State:** open **Merged:** No --- ## 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
yindo added the pull-request label 2026-02-16 18:16:16 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#11431