fix(core): tell the model search is synchronous (#50417)

This commit is contained in:
Aiden Cline
2026-09-21 14:35:46 -05:00
committed by GitHub
parent 97e833a297
commit 4c944a86d7
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ const prompt = (hasMoreTools: boolean) => `# Code Mode
Use the \`execute\` tool to call the tools listed below. They cannot be called directly${hasMoreTools ? ", and neither can \`search\`. Both" : ". They"} only work inside code you pass to \`execute\`.
${hasMoreTools ? `The catalog is partial. Inside \`execute\`, use \`search(...)\` to find a tool, then call it by the \`path\` in the result. Do not guess tool names.
${hasMoreTools ? `The catalog is partial. Inside \`execute\`, use \`search(...)\` to find a tool, then call it by the \`path\` in the result. \`search\` is synchronous. Call it without \`await\`; it does not return a Promise. Do not guess tool names.
- ${searchSignature}` : "The catalog is complete. Do not guess tool names."}
+1 -1
View File
@@ -131,7 +131,7 @@ describe("CodeModeInstructions.render", () => {
expect(partial).toContain("- orders (1 tool, none shown)")
expect(partial).toContain("They cannot be called directly, and neither can `search`.")
expect(partial).toContain(
"The catalog is partial. Inside `execute`, use `search(...)` to find a tool, then call it by the `path` in the result.",
"The catalog is partial. Inside `execute`, use `search(...)` to find a tool, then call it by the `path` in the result. `search` is synchronous. Call it without `await`; it does not return a Promise.",
)
expect(partial).toContain("- search(input: {")
expect(partial).toContain(" /** @integer @exclusiveMinimum 0 */\n limit?: number,")