You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Diff current deferred tools against what's already been announced in
1399
+
// prior <available-deferred-tools> injections. Only re-inject when new
1400
+
// tools appear (e.g. MCP server connects mid-session).
1388
1401
constdeferredToolList=tools
1389
1402
.filter(t=>deferredToolNames.has(t.name))
1390
1403
.map(formatDeferredToolLine)
1391
1404
.sort()
1392
1405
.join('\n')
1406
+
1393
1407
if(deferredToolList){
1394
-
// Append to the end of the messages array (not prepend) so it
1395
-
// never抢占 <project-instructions> (CLAUDE.md) at the front.
1396
-
messagesForAPI=[
1397
-
...messagesForAPI,
1398
-
createUserMessage({
1399
-
content: `<system-reminder>\n<available-deferred-tools>\n${deferredToolList}\n</available-deferred-tools>\nIMPORTANT: The tools listed above are deferred-loading — they are NOT in your tool list. To use them, you MUST first discover a tool via SearchExtraTools, then invoke it with ExecuteExtraTool.\n\nSearchExtraTools and ExecuteExtraTool are core tools already in your tool list right now — call them directly, do NOT use Bash/Glob to find them.\n\nSteps:\n1. SearchExtraTools({"query": "select:<tool_name>"}) — discover the tool and its schema\n2. ExecuteExtraTool({"tool_name": "<name>", "params": {...}}) — invoke it with correct parameters\n</system-reminder>`,
content: `<system-reminder>\n<available-deferred-tools>\n${deferredToolList}\n</available-deferred-tools>\nIMPORTANT: The tools listed above are deferred-loading — they are NOT in your tool list. To use them, you MUST first discover a tool via SearchExtraTools, then invoke it with ExecuteExtraTool.\n\nSearchExtraTools and ExecuteExtraTool are core tools already in your tool list right now — call them directly, do NOT use Bash/Glob to find them.\n\nSteps:\n1. SearchExtraTools({"query": "select:<tool_name>"}) — discover the tool and its schema\n2. ExecuteExtraTool({"tool_name": "<name>", "params": {...}}) — invoke it with correct parameters\n</system-reminder>`,
0 commit comments