From a7dcf63c556268b53ff430747ae2e141e4cd4451 Mon Sep 17 00:00:00 2001 From: implecao Date: Mon, 1 Jun 2026 22:16:18 +0800 Subject: [PATCH] feat(web_search): enable parallel execution for read-only search tool MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- crates/tui/src/tools/web_search.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/tui/src/tools/web_search.rs b/crates/tui/src/tools/web_search.rs index 3e36ae5d4..8516cabd1 100644 --- a/crates/tui/src/tools/web_search.rs +++ b/crates/tui/src/tools/web_search.rs @@ -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 { let query = extract_search_query(&input)?; if query.is_empty() {