MCPcopy Index your code
hub / github.com/AI45Lab/Code / execute_sequential_tool_call

Method execute_sequential_tool_call

core/src/agent/tool_turn.rs:36–79  ·  view source on GitHub ↗
(
        &self,
        tool_call: ToolCall,
        state: &mut ExecutionLoopState,
        event_tx: &Option<mpsc::Sender<AgentEvent>>,
        session_id: Option<&str>,
        effective_prompt: &

Source from the content-addressed store, hash-verified

34 }
35
36 async fn execute_sequential_tool_call(
37 &self,
38 tool_call: ToolCall,
39 state: &mut ExecutionLoopState,
40 event_tx: &Option<mpsc::Sender<AgentEvent>>,
41 session_id: Option<&str>,
42 effective_prompt: &str,
43 ) -> anyhow::Result<()> {
44 state.record_tool_call();
45 let tool_start = std::time::Instant::now();
46
47 tracing::info!(
48 tool_name = tool_call.name.as_str(),
49 tool_id = tool_call.id.as_str(),
50 "Tool execution started"
51 );
52
53 if self
54 .handle_tool_preflight_guard(&tool_call, state, event_tx)
55 .await?
56 {
57 return Ok(());
58 }
59
60 let gate_decision = self.decide_tool_gate(&tool_call, state, session_id).await;
61
62 let normalized = self
63 .resolve_tool_gate_decision(gate_decision, &tool_call, event_tx)
64 .await;
65
66 self.complete_tool_call(
67 state,
68 ToolCompletionInput {
69 tool_call: &tool_call,
70 event_tx,
71 session_id,
72 effective_prompt,
73 tool_start,
74 normalized,
75 },
76 )
77 .await;
78 Ok(())
79 }
80}

Callers 1

execute_tool_turnMethod · 0.80

Calls 6

nowFunction · 0.85
record_tool_callMethod · 0.80
decide_tool_gateMethod · 0.80
complete_tool_callMethod · 0.80

Tested by

no test coverage detected