mirror of
https://gitee.com/zhangsken/opencode.git
synced 2026-10-16 10:30:01 +08:00
fix(core): tell the model search is synchronous (#50417)
This commit is contained in:
@@ -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."}
|
||||
|
||||
|
||||
@@ -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,")
|
||||
|
||||
Reference in New Issue
Block a user