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
feat(llc/budget): token-based budget mode β track agent budgets in token counts alongside dollar amountsΒ #8997
8π Paperclip #1756, 13π Paperclip #339. The LLC budget system tracks costs in cents (budget.py). Users running agents on subscription plans (Claude Max, ChatGPT Plus) or free-tier models cannot express budgets in dollar terms β they need token-count budgets instead.
What Users Want
Budget mode selector per agent: tokens or dollars
When in token mode: monthly token allowance, hard stop at limit
Token consumption displayed in agent activity log alongside cost
Projected token burn rate shown in budget dashboard
Shadow cost tracking (estimate dollar equivalent even for subscription agents)
AutoBot Fit
autobot-backend/llc/models/budget.py + autobot-backend/llc/services/ budget enforcement. Add budget_mode enum (cents | tokens) and token_limit field to the budget model. The watchdog scheduler (llc/scheduler/) already fires on cost overrun β extend to token overrun. Frontend: BudgetPolicies.vue.
Acceptance Criteria
Agent budget can be set in tokens or cents (not both)
Token consumption tracked per heartbeat run
Hard stop fires when token budget exceeded (same as dollar hard stop)
Budget dashboard shows token mode agents with token progress bar
Closed β merged to Dev_new_gui via PR #9998 (squash commit e6e3cff71).
Acceptance criteria:
β Budget in tokens OR cents: budget_mode + token_limit (schema pre-existed via migration 20260604_036; this PR added enforcement) β cross-mode 400 validation on PATCH
β Hard stop on token exhaustion: BudgetExhausted on ingest + watchdog β₯100% hard-stop/β₯80% soft-notify (token ratio), identical semantics to dollar mode; tokens-mode-without-limit falls back to dollar enforcement consistently across service + watchdog
β Shadow cost: USD accumulates in both modes; shadow_cost_usd in hard-stop payload, ~$X.XX in UI
36/36 budget tests; independent review APPROVE β M1 (stale tracker cache after PATCH β now invalidated) and M2 (watchdog/service disagreement on tokens-without-limit) fixed in-PR.
Discovery (pre-existing, noted by reviewer): directory-scoped pytest llc/tests/ breaks api tests via test_health_probe.py sys.modules stubbing β same family as #9995.
Activity
feat(llc/budget): token-based budget mode with shadow cost tracking (#β¦
github-actions commentedon Jun 11, 2026
PR #9998 (merged to
Dev_new_gui) references this issue with a close keyword.If this issue is fully resolved, close it manually. If work remains, no action is needed.
mrveiss commentedon Jun 11, 2026
Closed β merged to Dev_new_gui via PR #9998 (squash commit
e6e3cff71).Acceptance criteria:
budget_mode+token_limit(schema pre-existed via migration20260604_036; this PR added enforcement) β cross-mode 400 validation on PATCHtokens_in/tokens_out; accumulation enforcedBudgetExhaustedon ingest + watchdog β₯100% hard-stop/β₯80% soft-notify (token ratio), identical semantics to dollar mode; tokens-mode-without-limit falls back to dollar enforcement consistently across service + watchdogshadow_cost_usdin hard-stop payload,~$X.XXin UI36/36 budget tests; independent review APPROVE β M1 (stale tracker cache after PATCH β now invalidated) and M2 (watchdog/service disagreement on tokens-without-limit) fixed in-PR.
Discovery (pre-existing, noted by reviewer): directory-scoped
pytest llc/tests/breaks api tests viatest_health_probe.pysys.modules stubbing β same family as #9995.