Skip to content

feat: cost alerting & budget burn rate widget#245

Open
vivekchand wants to merge 1 commit intomainfrom
fix/gh-200-cost-alerting
Open

feat: cost alerting & budget burn rate widget#245
vivekchand wants to merge 1 commit intomainfrom
fix/gh-200-cost-alerting

Conversation

@vivekchand
Copy link
Owner

Closes #200

What

Surfaces the budget alerting system that was already built but hidden behind commented-out UI, and adds a new burn rate widget to the overview dashboard.

How

New /api/budget/burn-rate endpoint

  • Returns 7-day daily cost history (labelled Mon/Tue/etc)
  • Calculates daily average from non-zero days (avoids skewing on new installs)
  • Returns projected monthly cost (daily_avg * 30)
  • Includes budget limit headroom (daily_pct, monthly_pct)
  • Includes pause state so UI can show paused banner

Budget & Alerts button un-hidden

  • The openBudgetModal() button was commented out in both light and dark nav themes with a 'hidden until mature' note — it is mature now
  • Users can now access daily/weekly/monthly budget limits, auto-pause, alert rules, and Telegram notifications directly from the nav

Burn Rate widget on overview

  • Compact panel added to the overview right pane (below Active Tasks)
  • Shows: today's spend, 7-day daily average, projected monthly cost
  • Color-coded projected cost (green < $5, amber < $20, red >= $20)
  • Budget progress bars (shown only when limits are configured)
  • 7-day mini sparkline (current day highlighted in accent color)
  • Paused banner when auto-pause has triggered
  • Widget is hidden when there is no spend data (zero-cost / OAuth users)
  • Configure button opens the Budget & Alerts modal

Tests

6 new tests added — all 139 tests pass (+ 6 skipped E2E).

- Add /api/budget/burn-rate endpoint with 7-day daily history, daily avg, and projected monthly cost
- Un-hide Budget & Alerts modal button in both light/dark nav themes
- Add burn rate widget to overview right pane: today/avg/projected metrics, budget progress bars, 7-day sparkline, paused banner
- Widget auto-hides when no spend data present
- 6 new tests for burn-rate endpoint (all 139 tests pass)
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.

feat: Cost alerting & budget enforcement

1 participant