Skip to content

Know what the team costs, and cap it with monthly budgets - #58

Merged
danielehrhardt merged 1 commit into
mainfrom
feat/spend-budgets
Oct 4, 2026
Merged

danielehrhardt merged 1 commit into
mainfrom
feat/spend-budgets

Conversation

@danielehrhardt

Copy link
Copy Markdown
Contributor
  • Spend is booked when it is spent: one ledger row per stretch of a run,
    so a run that continues next month counts there, and spend stays when
    an agent is deleted. Past runs are booked once (old runs that stored the
    session's total count only what they added) and again after a restore.
  • Activity shows today, this week, this month and all time, and for the
    chosen period who and what kind of work the money went to.
  • Monthly budgets for the team (Settings → AI) and any agent (its
    settings; only the human sets them). You're told at 80% and at 100%.
  • At 100% automations, follow-ups and board tickets are held, not failed:
    the chat says "Held — the team's October budget is used up", the agent
    says "Held · budget used up", and the work continues by itself on the
    1st, as soon as you raise the budget, or now with "Let it run". Chats
    you start (and Run now) still run, with a note once a month. Unattended
    work can't hand work to an agent over budget; scheduled checks and
    dreams wait.
  • Managers can answer "what did we spend" with spend_overview; runs_list
    says when a run is held for a budget.
  • The phone says when a chat is held and can let it run.

Checks

  • pnpm typecheck: all packages pass
  • Core tests: 1390 pass, 10 skip, 0 fail (new: budgets.test.ts)
  • Desktop build and phone type check pass
  • Checked in the browser: Activity spend strip and breakdown, used-up banner with Let it run, held ticket chat, Settings → AI team budget, agent budget card, agents grid

Migration 52 (spend ledger, budget columns on paused runs). The new routes are GET /api/spend, GET /api/budgets and POST /api/budgets/release (Cloud: allowed; phone: closed). Cloud billing keeps GET /api/usage.

- Spend is booked when it is spent: one ledger row per stretch of a run,
  so a run that continues next month counts there, and spend stays when
  an agent is deleted. Past runs are booked once (old runs that stored the
  session's total count only what they added) and again after a restore.
- Activity shows today, this week, this month and all time, and for the
  chosen period who and what kind of work the money went to.
- Monthly budgets for the team (Settings → AI) and any agent (its
  settings; only the human sets them). You're told at 80% and at 100%.
- At 100% automations, follow-ups and board tickets are held, not failed:
  the chat says "Held — the team's October budget is used up", the agent
  says "Held · budget used up", and the work continues by itself on the
  1st, as soon as you raise the budget, or now with "Let it run". Chats
  you start (and Run now) still run, with a note once a month. Unattended
  work can't hand work to an agent over budget; scheduled checks and
  dreams wait.
- Managers can answer "what did we spend" with spend_overview; runs_list
  says when a run is held for a budget.
- The phone says when a chat is held and can let it run.
@danielehrhardt
danielehrhardt merged commit 2dcc427 into main Oct 4, 2026
6 of 8 checks passed
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.

1 participant