feat(codemode): say each execute call is a fresh program (#66007)

This commit is contained in:
Aiden Cline 2026-11-24 00:48:11 -06:00 • committed by GitHub
parent b5948e5229
commit 1d9a0a0000
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -119,6 +119,7 @@ const description = (full: boolean) =>
? "Run JavaScript in a confined Code Mode runtime to work with files and data, script tool calls and HTTP requests, and compose their results."
: "Run JavaScript in a confined Code Mode runtime to script tool calls and HTTP requests and compose their results.",
"Write plain JavaScript and send it exactly as written: no code fence, and no JSON or other wrapper around it.",
"Each call is a fresh program; nothing carries over from earlier calls.",
full
? "`fetch` is available for HTTP requests, and Bun's file APIs (`Bun.file`, `Bun.write`, `Bun.Glob`) for files, in place of Node's `fs`. Imports and timers are unavailable: there is no `setTimeout` or sleep. All other external access goes through `tools`."
: "`fetch` is available for HTTP requests. Imports, direct filesystem access, and timers are unavailable: there is no `setTimeout` or sleep. All other external access goes through `tools`.",

View file

@ -104,6 +104,7 @@ test("execute describes invariant Code Mode behavior", () => {
[
"Run JavaScript in a confined Code Mode runtime to script tool calls and HTTP requests and compose their results.",
"Write plain JavaScript and send it exactly as written: no code fence, and no JSON or other wrapper around it.",
"Each call is a fresh program; nothing carries over from earlier calls.",
"`fetch` is available for HTTP requests. Imports, direct filesystem access, and timers are unavailable: there is no `setTimeout` or sleep. All other external access goes through `tools`.",
"Inside `execute`, the only callable tools are those explicitly listed in the Code Mode catalog instructions or returned by the `search` function. Ignore tools shown outside the Code Mode catalog. They are not available in the Code Mode runtime.",
'Call tools through `tools` using only exact paths and signatures from the catalog. Do not infer or normalize tool names; preserve bracket notation such as `tools.<namespace>["tool-name"](input)`.',