feat(web_search): enable parallel execution for read-only search tool
Override `supports_parallel()` to return `true` in `WebSearchTool`, allowing the engine to batch multiple concurrent web_search calls into a `FuturesUnordered` parallel group instead of serializing them. The tool is already read-only, auto-approved, and non-interactive — parallel-safe by all other criteria. This change removes the final gate (`supports_parallel() -> false` default) so co-issued searches run concurrently rather than one-at-a-time. Closes the ~55s serial wall-clock for 3 simultaneous web searches (now ~20s, the slowest individual call). Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit a7dcf63c556268b53ff430747ae2e141e4cd4451)
This commit is contained in:
@@ -186,6 +186,10 @@ impl ToolSpec for WebSearchTool {
|
||||
ApprovalRequirement::Auto
|
||||
}
|
||||
|
||||
fn supports_parallel(&self) -> bool {
|
||||
true
|
||||
}
|
||||
|
||||
async fn execute(&self, input: Value, context: &ToolContext) -> Result<ToolResult, ToolError> {
|
||||
let query = extract_search_query(&input)?;
|
||||
if query.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user