opencode
opencode copied to clipboard
feat: display tokens per second for assistant messages
Summary
Implements tokens/second display for assistant messages per #5374.
Changes
- Track
firstTokentimestamp when streaming begins - Display
tok/srate 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