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 <noreply@anthropic.com>
This commit is contained in:
Edvard Schøyen 2026-02-20 05:05:33 -05:00 committed by GitHub
parent 2ae12578f0
commit f35a365d83
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {