You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(economics): use tracked monthly savings percentage #3972
This disagrees with DayStats, WeekStats, and MonthStats, which define savings percentage as saved_tokens / input_tokens * 100. Because saved_tokens = input_tokens - output_tokens, the current monthly-economics denominator is normally 2 * input_tokens, under-reporting the percentage by about half and skewing rtk_avg_savings_pct.
Proposed fix
Use MonthStats::savings_pct directly in set_rtk_from_month, matching the day and week paths. Add a focused monthly-economics regression test.
Scope
This is intentionally separate from #3958, which only propagates signed saved-token deltas. #3958 provides the negative-savings coverage once its signed model lands.
PeriodEconomics::set_rtk_from_month recomputes savings percentage with a different (inconsistent) formula than DayStats/WeekStats/MonthStats, halving reported monthly savings; fix by reusing MonthStats::savings_pct and add regression tests.
This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.
📁 Relevant files
src/economics.rs
Triaged automatically by wshm · This is an automated analysis, not a human review.
Activity
rtk-wshm-sync-bot commentedon Sep 10, 2026
🔍 Automated Triage
bugmediumSummary
PeriodEconomics::set_rtk_from_month recomputes savings percentage with a different (inconsistent) formula than DayStats/WeekStats/MonthStats, halving reported monthly savings; fix by reusing MonthStats::savings_pct and add regression tests.
📁 Relevant files
src/economics.rsTriaged automatically by wshm · This is an automated analysis, not a human review.