diff --git a/packages/core/src/codemode/instructions.ts b/packages/core/src/codemode/instructions.ts index a87a677d7c6..859c941f275 100644 --- a/packages/core/src/codemode/instructions.ts +++ b/packages/core/src/codemode/instructions.ts @@ -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."} diff --git a/packages/core/test/codemode/catalog.test.ts b/packages/core/test/codemode/catalog.test.ts index 6132fdee505..c15fee05e12 100644 --- a/packages/core/test/codemode/catalog.test.ts +++ b/packages/core/test/codemode/catalog.test.ts @@ -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,")