#1639
Add an experimental execute tool for code mode
Summary
- Offer the model an
executetool when theexperimental.code_modesetting is on. It runs a short JavaScript program in the sandboxed child. The setting is off by default and profile-only:fx config set experimental.code_mode true, orfx ask --config experimental.code_mode=truefor one run. - Run each
await tools.<name>(args)call a program makes like a direct call: validation, permission admission, and authorized execution. Any tool name works, including an MCP tool the model hasn't loaded. - In
automode, review each call a program makes on its own, with the program's earlier results as evidence, sharing the turn's review budget and holds. - Return only the program's value, its
consoleoutput, and a list of its tool calls to the model. - Refuse
execute,ask_user_question, andsubagentinside a program. A program gets 30 s of JavaScript time, which excludes time spent in tool calls, 64 MiB of heap, and at most 256 tool calls. - Never offer
executein libfx.
Docs
- Settings reference: add
experimental.code_mode(boolean, default false, profile only). It offers theexecutetool, which runs a JavaScript program that calls the model's tools in a sandbox, on macOS and on Linux x86_64 and arm64.
Stacked on #1638.
Activity
6This pull request is a draft
Merging is unavailable until it is marked ready for review.
Security review details