MCPcopy Create free account
hub / github.com/AI45Lab/Code / with_budget

Method with_budget

core/src/orchestration/workflow.rs:124–127  ·  view source on GitHub ↗

Attach the shared budget ledger this workflow reports on. The SAME `Arc ` must also be installed as the executor's child `budget_guard` (the in-box wiring is done by [`AgentSession::workflow`](crate::AgentSession::workflow)); the workflow only *reads* it for [`budget_snapshot`](Workflow::budget_snapshot) and to emit [`WorkflowEvent::BudgetExhausted`].

(mut self, budget: Arc<WorkflowBudget>)

Source from the content-addressed store, hash-verified

122 /// only *reads* it for [`budget_snapshot`](Workflow::budget_snapshot) and to
123 /// emit [`WorkflowEvent::BudgetExhausted`].
124 pub fn with_budget(mut self, budget: Arc<WorkflowBudget>) -> Self {
125 self.budget = Some(budget);
126 self
127 }
128
129 /// Persist progress so each [`phase`](Workflow::phase) becomes a resume
130 /// boundary. Without a store, phases run as plain (non-resumable) barriers.

Calls

no outgoing calls

Tested by

no test coverage detected