(
&self,
tool_calls: Vec<ToolCall>,
state: &mut ExecutionLoopState,
event_tx: &Option<mpsc::Sender<AgentEvent>>,
session_id: Option<&str>,
effective_pro
| 6 | |
| 7 | impl AgentLoop { |
| 8 | pub(super) async fn execute_tool_turn( |
| 9 | &self, |
| 10 | tool_calls: Vec<ToolCall>, |
| 11 | state: &mut ExecutionLoopState, |
| 12 | event_tx: &Option<mpsc::Sender<AgentEvent>>, |
| 13 | session_id: Option<&str>, |
| 14 | effective_prompt: &str, |
| 15 | ) -> anyhow::Result<()> { |
| 16 | if self.can_run_parallel_write_batch(&tool_calls) { |
| 17 | self.execute_parallel_write_batch(&tool_calls, state, event_tx) |
| 18 | .await; |
| 19 | return Ok(()); |
| 20 | } |
| 21 | |
| 22 | for tool_call in tool_calls { |
| 23 | self.execute_sequential_tool_call( |
| 24 | tool_call, |
| 25 | state, |
| 26 | event_tx, |
| 27 | session_id, |
| 28 | effective_prompt, |
| 29 | ) |
| 30 | .await?; |
| 31 | } |
| 32 | |
| 33 | Ok(()) |
| 34 | } |
| 35 | |
| 36 | async fn execute_sequential_tool_call( |
| 37 | &self, |
no test coverage detected