(&self, session_id: &str, tool_name: &str)
| 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)] |
nothing calls this directly
no test coverage detected