MechanismArticle
Instead of including all available tool schemas in every prompt, OpenAI defers tool discovery — loading schemas on demand via BM25 search — and in Code Mode lets the model write a JavaScript program that executes multiple tool calls in parallel, reducing round trips and keeping intermediate data out of context.
OpenAI keeps hundreds of tool definitions out of the prompt by having the model search for tools when needed (deferred discovery), and in Code Mode the model writes JavaScript programs that can fan out independent tool calls in parallel, returning only the compact final result. ✦ AI generated
Artificial Analysis · ByteByteGo Newsletter · 2026-07-29 · original ↗
With Code Mode, instead of emitting tool calls one by one, the model writes a small program that makes those calls. The harness runs this program in an embedded JavaScript runtime, where every tool is available as a function. The script can fan out independent calls in parallel, filter and join the results in plain code, and return only the compact answer. This way, the intermediate data stays in the runtime, and only the final result enters the context.
Read full article ↗excerpt · fair-use quotation
Around this claim