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:
parent
2ae12578f0
commit
f35a365d83
1 changed files with 2 additions and 5 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue