Jelajahi Sumber

fix(core): clarify empty Code Mode guidance (#38883)

Aiden Cline 3 minggu lalu
induk
melakukan
cce8bb0e1c

+ 1 - 1
packages/core/src/codemode/instructions.ts

@@ -18,7 +18,7 @@ Use \`search\` to discover exact paths and signatures for additional tools:
 
 export function render(catalog: CodeModeCatalog.Summary) {
   if (catalog.total === 0)
-    return "No Code Mode tools are currently available. Do not call `execute` until a later system update announces available tools."
+    return "No Code Mode tools are currently available. Later Code Mode catalog updates may add or remove tools. Do not call `execute` unless there is at least one available Code Mode tool."
 
   const tools = catalog.namespaces.flatMap((namespace) => {
     const count = namespace.count === 1 ? "1 tool" : `${namespace.count} tools`

+ 1 - 1
packages/core/test/codemode/catalog.test.ts

@@ -114,7 +114,7 @@ describe("CodeModeInstructions.render", () => {
 
   test("renders only the no-tools notice for an empty catalog", () => {
     expect(render([])).toBe(
-      "No Code Mode tools are currently available. Do not call `execute` until a later system update announces available tools.",
+      "No Code Mode tools are currently available. Later Code Mode catalog updates may add or remove tools. Do not call `execute` unless there is at least one available Code Mode tool.",
     )
   })
 })

+ 2 - 2
packages/core/test/codemode/instructions.test.ts

@@ -25,7 +25,7 @@ describe("CodeModeInstructions", () => {
     Effect.gen(function* () {
       const initialized = yield* readInitial(CodeModeInstructions.make([]))
       expect(initialized.text).toBe(
-        "No Code Mode tools are currently available. Do not call `execute` until a later system update announces available tools.",
+        "No Code Mode tools are currently available. Later Code Mode catalog updates may add or remove tools. Do not call `execute` unless there is at least one available Code Mode tool.",
       )
 
       const added = yield* readUpdate(CodeModeInstructions.make([echo]), initialized)
@@ -35,7 +35,7 @@ describe("CodeModeInstructions", () => {
       expect(yield* readUpdate(CodeModeInstructions.make([]), { values: added.values })).toMatchObject({
         text:
           "The Code Mode tool catalog has changed. This catalog supersedes the previous Code Mode tool catalog.\n\n" +
-          "No Code Mode tools are currently available. Do not call `execute` until a later system update announces available tools.",
+          "No Code Mode tools are currently available. Later Code Mode catalog updates may add or remove tools. Do not call `execute` unless there is at least one available Code Mode tool.",
       })
     }),
   )