From f35a365d830a5a49546acec03a2b00a904c98b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Sch=C3=B8yen?= <99178202+ecschoye@users.noreply.github.com> Date: Fri, 20 Feb 2026 05:05:33 -0500 Subject: [PATCH] fix(agent): implement actual concurrent tool execution (#1001) When parallel_tools is enabled, both code branches in execute_tools() ran the same sequential for loop. The parallel path was a no-op. Use futures::future::join_all to execute tool calls concurrently when parallel_tools is true. The futures crate is already a dependency. Co-authored-by: Claude Opus 4.6 --- src/agent/agent.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/agent/agent.rs b/src/agent/agent.rs index e96d797..5f048e2 100644 --- a/src/agent/agent.rs +++ b/src/agent/agent.rs @@ -403,11 +403,8 @@ impl Agent { return results; } - let mut results = Vec::with_capacity(calls.len()); - for call in calls { - results.push(self.execute_tool_call(call).await); - } - results + let futs: Vec<_> = calls.iter().map(|call| self.execute_tool_call(call)).collect(); + futures::future::join_all(futs).await } fn classify_model(&self, user_message: &str) -> String {