Workflow: Handle Budget Breach¶
Realizes: spec_v3.md §4.3 Structured Invocation Logging
and the $20/day pause policy in CLAUDE.md.
Policy¶
- Hard monthly cap: $100 on Claude API.
- Daily soft pause: $20/day — all autonomous agent work stops.
- Every API call is logged to
invocation_logwith cost in USD.
Detection Path¶
flowchart LR
Call[skill calls ModelRouter.complete] --> Guard{budget_guard.check}
Guard -- under --> Run[run model]
Run --> Log[append invocation_log]
Log --> Ret[return]
Guard -- over --> Pause[raise BudgetExceeded]
Pause --> Notify[notify user via Discord]
What Happens When the Gate Trips¶
donna.cost.budget_guardrejects the call before it hits a provider.- Autonomous paths short-circuit; interactive paths surface a message.
- A Discord DM summarizes spend and tells Nick what got paused.
- Pauses clear automatically at UTC midnight (daily) or at month rollover.
Manually Unsticking¶
- Inspect recent spend:
- Temporarily raise the daily threshold in
config/donna_models.yaml(with explicit reason — safety-first dial, not a default). - Route the offending task type to a cheaper alias (Ollama) by editing the router config. See Domain → Model Layer.