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

Method check_before_tool

core/src/orchestration/workflow_budget.rs:133–144  ·  view source on GitHub ↗
(&self, session_id: &str, tool_name: &str)

Source from the content-addressed store, hash-verified

131 }
132
133 async fn check_before_tool(&self, session_id: &str, tool_name: &str) -> BudgetDecision {
134 if self.is_exhausted() {
135 return BudgetDecision::Deny {
136 resource: "workflow_tokens".to_string(),
137 reason: "workflow token budget exhausted".to_string(),
138 };
139 }
140 match &self.inner {
141 Some(inner) => inner.check_before_tool(session_id, tool_name).await,
142 None => BudgetDecision::Allow,
143 }
144 }
145}
146
147#[cfg(test)]

Callers

nothing calls this directly

Calls 1

is_exhaustedMethod · 0.80

Tested by

no test coverage detected