fix(searcher): disable parallel tool calls and remove stale card_id from search-result props
- 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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
87d1a5f937
commit
869d3d54f9
@@ -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() };
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user