From 869d3d54f93ed81dee55de8a3973540111d1a36d Mon Sep 17 00:00:00 2001 From: gongzhiyong Date: Mon, 13 Apr 2026 00:26:24 +0800 Subject: [PATCH] fix(searcher): disable parallel tool calls and remove stale card_id from search-result props MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add parallel_tool_calls: false to searcher agentNode bindTools call so the LLM is forced to execute search tools one at a time (google_search first, then web_read in a separate turn); prompt-level "strict禁止" alone cannot override model-side parallel tool calling behaviour - Remove card_id field from google_search and web_search_deep ui.push props; SearchResultProps does not declare card_id so the field caused TS2769 overload errors; these cards do not need deduplication (each search is a distinct query), while the card_id variables were introduced by a previous commit and are now unused - Clean up unused googleCardId and deepCardId local variables Co-Authored-By: Claude Sonnet 4.6 --- langgraph/src/agent/searcher/nodes/agent.ts | 4 +++- langgraph/src/agent/searcher/nodes/tool-executor.ts | 4 ---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/langgraph/src/agent/searcher/nodes/agent.ts b/langgraph/src/agent/searcher/nodes/agent.ts index 5d5275e..329ca61 100644 --- a/langgraph/src/agent/searcher/nodes/agent.ts +++ b/langgraph/src/agent/searcher/nodes/agent.ts @@ -97,6 +97,8 @@ export async function agentNode( ...truncated, ]; - const message = await llm.bindTools([...SEARCHER_TOOLS]).invoke(messagesWithSystem); + const message = await llm + .bindTools([...SEARCHER_TOOLS], { parallel_tool_calls: false }) + .invoke(messagesWithSystem); return { messages: [message], timestamp: Date.now() }; } diff --git a/langgraph/src/agent/searcher/nodes/tool-executor.ts b/langgraph/src/agent/searcher/nodes/tool-executor.ts index 342a12d..f816cd0 100644 --- a/langgraph/src/agent/searcher/nodes/tool-executor.ts +++ b/langgraph/src/agent/searcher/nodes/tool-executor.ts @@ -59,7 +59,6 @@ export async function toolExecutorNode( switch (name) { case "google_search": { const parsed = googleSearchSchema.parse(args); - const googleCardId = `google-search-${tc.id}`; let results: Array<{ title: string; url: string; snippet: string }>; let knowledgeGraph: { title: string; description: string } | undefined; let fallbackUsed = false; @@ -104,7 +103,6 @@ export async function toolExecutorNode( { name: "search-result", props: { - card_id: googleCardId, query: parsed.query, total: results.length, results, @@ -141,7 +139,6 @@ export async function toolExecutorNode( case "web_search_deep": { const parsed = webSearchDeepSchema.parse(args); - const deepCardId = `web-search-deep-${tc.id}`; let enriched: Array<{ title: string; url: string; snippet: string }>; let fallbackUsed = false; let readerAllFailed = false; @@ -205,7 +202,6 @@ export async function toolExecutorNode( { name: "search-result", props: { - card_id: deepCardId, query: parsed.query, total: enriched.length, results: enriched,