pub struct AgentBudget {
pub max_tokens: Option<u64>,
pub max_cost_usd: Option<f64>,
pub deadline: Option<DateTime<Utc>>,
}Expand description
An agent-level budget ceiling (R0.7): the whole-activity bound across
turns, the way crate::durable::TaskBudget bounds one task across its
attempts.
Every field is optional and omitted from the wire when unset, so a
manifest carrying no budget — or a partial one — produces no shape
change for older readers. None means unbounded within the tenant’s
own quotas, never an invented default.
Fields§
§max_tokens: Option<u64>Token ceiling across all of the agent’s turns.
max_cost_usd: Option<f64>Cost ceiling in USD across all turns. Evidence-grade f64, matching
crate::record::RunEvent::cost_usd: the ledger aggregates
elsewhere.
deadline: Option<DateTime<Utc>>Wall-clock deadline for the whole agent activity, across turns.
Expiry is cancellation by clock one level up from
crate::durable::TaskEnvelope::deadline: the server stamps it
onto the agent’s mailbox messages (the earlier bound wins), and its
breach is a supervision signal — the turn’s outstanding work is
cancelled, journaled, and the declared SupervisionPolicy
decides restart vs escalate (R0.7 wave 2).