Releases: ChiR24/opencode-tps-meter
Releases · ChiR24/opencode-tps-meter
v0.2.0: Realistic TPS and Better Agent IDs
Improvements
Fixed
- Inflated TPS values — Changed denominator from to . This prevents 300+ TPS spikes when tokens arrive in bursts by accounting for idle time that naturally lowers the rate.
- Identical agent labels — All agents showed because OpenCode message IDs share the prefix. Now strips this prefix and shows 6 differentiating characters.
Changed
- Faster timing constants for more responsive feel:
- : 250ms → 150ms (40% faster initial display)
- : 500ms → 250ms (more responsive smoothing)
- : 150ms → 80ms (nearly 2x faster UI updates)
- : 0.1s → 0.3s (stable baseline)
- Reduced toast throttling — multiplier: 3x → 2x
Commits
- fix: correct TPS calculation to use elapsed time from oldest entry
- feat: improve TPS responsiveness with faster timing constants
- fix: improve agent ID display and reduce UI throttling
- docs: update README timing and bump version to 0.2.0
0.1.9
Full Changelog: v0.1.8...0.1.9
v0.1.8 - Agent Detection Improvements
Improvements
- Improved agent name detection from multiple sources
- Better handling of missing agent metadata
- Added debug logging for troubleshooting
Bug Fixes
- Fixed
buildAgentLabelto handle missing type gracefully - Improved
getAllActiveAgentsGloballyto get agent name from cache when metadata is missing
v0.1.7 - Bug Fixes
Bug Fixes
- Agent name caching fixed - Previously the cache was never populated because
info.agentis anAgentIdentityobject (not a string). Now correctly extracts name from:agent.name > agent.type > agentType > agent.id - Color coding in agent-only mode - Previously showed "slow" (red) because TPS was 0. Now uses max agent TPS for color determination
- formatAgentLine respects config - Now properly uses
showInstant,showAverage,showTotalTokenssettings instead of always showing all
Files Changed
src/index.ts- Fixed agent name extraction from AgentIdentity objectsrc/ui.ts- Fixed color coding logic and formatAgentLine config respect
v0.1.6 - Multi-agent TPS Tracking
What's New
Multi-Agent TPS Tracking
- Per-agent display: Each background agent (explore, librarian, etc.) now shows its own TPS instead of combined values
- Agent name caching: Uses
info.agentfrommessage.updatedevents for proper labels - Explicit primary session: Stores primarySessionId instead of iteration-based detection
- Show/hide logic: Main TPS line hidden when only background agents are active
TPS Spike Prevention
- 3-level burst smoothing:
- Normal streaming: 500ms half-life
- Medium bursts (50-200 tokens): 3000ms half-life
- Large bursts (200+ tokens): 5000ms half-life
- Initial TPS cap: Max 100 TPS on first reading to prevent startup spikes
UI Improvements
- Shorter IDs: Reduced from 8 to 4 characters for more compact display
- Timer-based fallback: Shows TPS after 250ms even if stream pauses
Testing
- Added 33 comprehensive tests for multi-agent scenarios
- All tests passing
Installation
npm install opencode-tps-meter@0.1.6Or in OpenCode config:
{
"plugins": ["opencode-tps-meter@0.1.6"]
}v0.1.5 - EWMA Smoothing for TPS Spike Prevention
What's New
Features
- EWMA Smoothing: Added Exponentially Weighted Moving Average (EWMA) smoothing to prevent unrealistic TPS spikes from bursty token arrivals (e.g., tool outputs)
- Adaptive Half-Life: Normal streaming uses 500ms half-life, bursts (>120 tokens) use 2000ms for stronger smoothing
- New method: Returns EWMA-smoothed TPS values for more stable UI display
Bug Fixes
- Fixed buffer pruning bug: When all entries were expired, returned -1 and nothing was removed - now properly clears the buffer
- Renamed misleading variable: → to accurately reflect the smoothed value
Technical Details
- Added constants: (120), (500), (2000)
- Buffer pruning now uses in-place mutation () instead of reassignment
- Enhanced test coverage for burst smoothing scenarios
Breaking Changes
None - the plugin now displays smoothed TPS by default, providing more accurate and stable metrics.
Testing
- All 28 tests pass
- Build successful (ESM + CJS + TypeScript declarations)
- Verified smoothing behavior with large token bursts
v0.1.4 - CJS/ESM Compatibility Fix
Fixes
- CJS Export Timing: Move module.exports to end of file to ensure TpsMeterPlugin function is defined before export
- ESM Compatibility: Add module.exports.default and __esModule flag for proper ESM/CJS interop
- dist/package.json: Create separate package.json in dist folder with type:commonjs to fix Node.js loading
This resolves the 'fn3 is not a function' error when loading the plugin in OpenCode.
v0.1.3 - Fix CJS Export
Fixed: Plugin function was being called during module load instead of being exported
v0.1.2 - Config Fix
Fix config undefined error
v0.1.1 - Bug Fix Release
🐛 Bug Fix Release v0.1.1
Fixed
- Config undefined error: Added defensive check to handle edge case where config could be undefined
- Fixed
Installation
Or use latest:
Changes
- Added null/undefined check for config loading
- Updated README with NPM as primary installation method
- Bumped version to 0.1.1