Map reliability, operator UX, and spend-control follow-ons onto epics 1–9 so worker, webhooks, and fleet work have bead-scale task briefs. Co-authored-by: Cursor <cursoragent@cursor.com>
2 KiB
2 KiB
| kind | slug | title | plan_slug | epic_slug | status | priority | tenant_id | owner | cursor_todo_id | updated_at |
|---|---|---|---|---|---|---|---|---|---|---|
| task | cost-budget-ui-and-caps | Cost visibility and dispatch budget caps | automation-foundation | model-provider-registry | draft | P2 | global | unassigned | null | 2026-08-03 |
Task summary
Surface spend from convoy_events.estimated_cost_usd and agent_runs token metadata; add optional workspace budget caps that pause orchestrator dispatch when exceeded.
Description
Benchmark: Autensa per-task/product cost tracking and daily/monthly budget caps. Epic 1 deferred billing — this follow-on uses data already on convoy_events and run completion.
Read path (UI)
- Settings → AI → Usage & budgets
- Rollups: today / this month by
model_alias, by convoy, by role - Mission control convoy detail: spend to date for selected convoy
Write path (enforcement)
workspace_budget_capstable:period(daily|monthly),cap_usd,action(pause_dispatch|warn_only)- Orchestrator tick: sum
estimated_cost_usdfor period; if over cap andpause_dispatch, skip newrole_dispatchenqueue and write health event
Cost estimation
- Worker/orchestrator populate
estimated_cost_usdonconvoy_events.role_completeusing provider-reported usage × static price table in shared config (v1 — no live pricing API)
Dependencies
- Epic 1 model registry +
convoy_eventscost column (shipped) - Epic 7 worker records token totals on complete
Subtasks
- Price table stub in
packages/shared(document as operator-editable later) - tRPC usage queries (workspace-scoped aggregates)
- Settings usage page
- Budget cap schema + orchestrator guard
Estimation
M
Acceptance criteria
- Settings shows month-to-date spend grouped by model alias
- With cap set and exceeded, orchestrator logs skip reason and does not enqueue new jobs
- Warn-only cap emits event but does not block dispatch
Links
- Epic:
./Epic-model-provider-registry.md - Unblocks: Epic 9 fleet spend rollup