pub enum RunFailureKind {
BudgetExceeded,
OwnershipMismatch,
OriginMissing,
}Expand description
Typed failure categories for run governance (Lane B3 / C3). Emitted by the engine when a run-side invariant rejects a tool dispatch. The variants here are wire-stable so downstream consumers (desktop budget meter, error toasts, telemetry) can react deterministically — every failure has a discriminator and the call site that produced it.
Variants§
BudgetExceeded
Per-run concurrent or cumulative sub-agent limit was hit.
concurrent is the active-running count for the run; cumulative is
the total accepted across the run’s lifetime. The exact limit
(whichever the call exceeded) is carried on the typed payload.
OwnershipMismatch
A caller tried to mutate, cancel, or read another run’s state.
Operations on run_id must come from a session that actually owns
(or is delegated by) that run; cross-run access is rejected here
rather than silently diverging.
OriginMissing
A durable ToolCallStarted origin record was required before the side
effect fired, and the persistence seam returned an error. The engine
must NOT execute the call in this state.