Skip to content

Fix inflated velocity calculation in Usage Pace - #4

Merged
stevensouza merged 1 commit into
mainfrom
stevensouza/fix-velocity-calc
Feb 27, 2026
Merged

stevensouza merged 1 commit into
mainfrom
stevensouza/fix-velocity-calc

Conversation

@stevensouza

Copy link
Copy Markdown
Owner

Summary

Replaced active-only velocity calculation with average velocity, fixing wildly inflated burn rates (e.g., 429%/hr when only 23% consumed). The old algorithm only counted seconds when utilization increased, causing idle periods to be completely ignored.

Changes

  • computeVelocity() now calculates: (last% - first%) / total elapsed hours
  • Affects session, weekly, and all-time velocity displays
  • Downstream consumers (time remaining, per-model estimates, budget advisor) automatically benefit with corrected values
  • Reduced function from 24 to 13 lines; cleaner and correct

Testing

  • Built and linted successfully
  • With this fix, 23% consumed over ~2 hours now shows ~11.5%/hr (realistic) instead of 429%/hr

🤖 Generated with Claude Code

Replace active-only velocity (which only counted time when utilization changed) with average velocity (total % change / total elapsed time). This fixes wildly inflated burn rates like 429%/hr when only 23% has been consumed, making time remaining estimates accurate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@stevensouza
stevensouza merged commit 2b1ad23 into main Feb 27, 2026
2 checks passed
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.

1 participant