Skip to main content

Interface: RunSpend

Defined in: packages/orchestration/src/cost/spend-store.ts:15

Spend that every instance sees.

CostTracker keeps spend in memory, which on serverless means each instance knows only the runs it ran — an agent's budgetTotal and a ticket's budget would each be checked against a fraction of the truth. A SpendStore records each run's cost where every instance reads it; the tracker loads the totals before a run starts (budgets are checked against them) and writes the run's cost when it ends.

InMemorySpendStore is the single-process default; @baleybots/postgres ships PostgresSpendStore.

Properties​

agentName​

agentName: string

Defined in: packages/orchestration/src/cost/spend-store.ts:17


runId​

runId: string

Defined in: packages/orchestration/src/cost/spend-store.ts:16


ticketId​

ticketId: string

Defined in: packages/orchestration/src/cost/spend-store.ts:18


usd​

usd: number

Defined in: packages/orchestration/src/cost/spend-store.ts:20

The run's whole cost in USD. Recording a run again replaces its cost (a retried write never double-counts).