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,
|
...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() };
|
return { messages: [message], timestamp: Date.now() };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ export async function toolExecutorNode(
|
|||||||
switch (name) {
|
switch (name) {
|
||||||
case "google_search": {
|
case "google_search": {
|
||||||
const parsed = googleSearchSchema.parse(args);
|
const parsed = googleSearchSchema.parse(args);
|
||||||
const googleCardId = `google-search-${tc.id}`;
|
|
||||||
let results: Array<{ title: string; url: string; snippet: string }>;
|
let results: Array<{ title: string; url: string; snippet: string }>;
|
||||||
let knowledgeGraph: { title: string; description: string } | undefined;
|
let knowledgeGraph: { title: string; description: string } | undefined;
|
||||||
let fallbackUsed = false;
|
let fallbackUsed = false;
|
||||||
@@ -104,7 +103,6 @@ export async function toolExecutorNode(
|
|||||||
{
|
{
|
||||||
name: "search-result",
|
name: "search-result",
|
||||||
props: {
|
props: {
|
||||||
card_id: googleCardId,
|
|
||||||
query: parsed.query,
|
query: parsed.query,
|
||||||
total: results.length,
|
total: results.length,
|
||||||
results,
|
results,
|
||||||
@@ -141,7 +139,6 @@ export async function toolExecutorNode(
|
|||||||
|
|
||||||
case "web_search_deep": {
|
case "web_search_deep": {
|
||||||
const parsed = webSearchDeepSchema.parse(args);
|
const parsed = webSearchDeepSchema.parse(args);
|
||||||
const deepCardId = `web-search-deep-${tc.id}`;
|
|
||||||
let enriched: Array<{ title: string; url: string; snippet: string }>;
|
let enriched: Array<{ title: string; url: string; snippet: string }>;
|
||||||
let fallbackUsed = false;
|
let fallbackUsed = false;
|
||||||
let readerAllFailed = false;
|
let readerAllFailed = false;
|
||||||
@@ -205,7 +202,6 @@ export async function toolExecutorNode(
|
|||||||
{
|
{
|
||||||
name: "search-result",
|
name: "search-result",
|
||||||
props: {
|
props: {
|
||||||
card_id: deepCardId,
|
|
||||||
query: parsed.query,
|
query: parsed.query,
|
||||||
total: enriched.length,
|
total: enriched.length,
|
||||||
results: enriched,
|
results: enriched,
|
||||||
|
|||||||
Reference in New Issue
Block a user