diff --git a/packages/codemode/src/codemode.ts b/packages/codemode/src/codemode.ts index 35a96c4a7e..1f99c01e74 100644 --- a/packages/codemode/src/codemode.ts +++ b/packages/codemode/src/codemode.ts @@ -120,13 +120,6 @@ export type Runtime = { readonly execute: (code: string) => Effect.Effect } -export const description = [ - "Run JavaScript in a confined Code Mode runtime through { code }.", - "Call Code Mode tools through `tools` using the exact paths and signatures from the instructions.", - "Use `search({ query })` to discover exact signatures when needed.", - "Await important calls and use `Promise.all` for independent calls.", -].join("\n") - const validateLimit = (name: keyof ExecutionLimits, value: number | undefined, minimum: number): number | undefined => { if (value !== undefined && (!Number.isSafeInteger(value) || value < minimum)) { throw new RangeError(`${name} must be a safe integer greater than or equal to ${minimum}.`) diff --git a/packages/codemode/test/codemode.test.ts b/packages/codemode/test/codemode.test.ts index f884875915..e2c91e7f4e 100644 --- a/packages/codemode/test/codemode.test.ts +++ b/packages/codemode/test/codemode.test.ts @@ -550,23 +550,6 @@ describe("CodeMode schema flexibility", () => { }) describe("CodeMode public contract", () => { - test("keeps the tool description independent from the catalog", () => { - const runtime = CodeMode.make({ - tools: { - lookup: Tool.make({ - description: "Look up a record", - input: Schema.Struct({}), - output: Schema.String, - run: () => Effect.succeed("found"), - }), - }, - }) - - expect(CodeMode.description).toContain("confined Code Mode runtime") - expect(CodeMode.description).not.toContain("lookup") - expect(runtime.instructions()).toContain("tools.lookup(input:") - }) - const lookup = Tool.make({ description: "Look up an order by ID", input: Schema.Struct({ id: Schema.String }), diff --git a/packages/core/src/tool/execute.ts b/packages/core/src/tool/execute.ts index de062dd372..b9ffa751e3 100644 --- a/packages/core/src/tool/execute.ts +++ b/packages/core/src/tool/execute.ts @@ -42,9 +42,17 @@ export interface Registration { readonly namespace?: string } +// Invariant model-facing guidance; the changing tool catalog is delivered through Instructions. +const description = [ + "Run JavaScript in a confined Code Mode runtime through { code }.", + "Call Code Mode tools through `tools` using the exact paths and signatures from the instructions.", + "Use `search({ query })` to discover exact signatures when needed.", + "Await important calls and use `Promise.all` for independent calls.", +].join("\n") + export const create = (registrations: ReadonlyMap) => { return make({ - description: CodeMode.description, + description, input: CodeMode.Input, output: ExecuteOutput, structured: ExecuteMetadata,