(
&self,
tool_call: &ToolCall,
state: &ExecutionLoopState,
session_id: Option<&str>,
)
| 10 | |
| 11 | impl AgentLoop { |
| 12 | pub(super) async fn decide_tool_gate( |
| 13 | &self, |
| 14 | tool_call: &ToolCall, |
| 15 | state: &ExecutionLoopState, |
| 16 | session_id: Option<&str>, |
| 17 | ) -> ToolGateDecision { |
| 18 | let pre_tool_block = match self |
| 19 | .fire_pre_tool_use( |
| 20 | session_id.unwrap_or(""), |
| 21 | &tool_call.name, |
| 22 | &tool_call.args, |
| 23 | state.recent_tool_signatures(), |
| 24 | ) |
| 25 | .await |
| 26 | { |
| 27 | Some(crate::hooks::HookResult::Block(reason)) => Some(reason), |
| 28 | _ => None, |
| 29 | }; |
| 30 | |
| 31 | ToolSafetyGate::new(&self.config) |
| 32 | .decide(ToolGateInput { |
| 33 | tool_name: &tool_call.name, |
| 34 | args: &tool_call.args, |
| 35 | pre_tool_block, |
| 36 | }) |
| 37 | .await |
| 38 | } |
| 39 | |
| 40 | pub(super) async fn resolve_tool_gate_decision( |
| 41 | &self, |
no test coverage detected