Agent Codemode Explained
Code Mode: Moving Agent Control Flow Out of the LLM
Most agents still use tools one call at a time.
The model decides to call a tool. The runtime executes it. The result is appended to the conversation. The model runs again and decides what to do next.
For a short task this works well.
For a task that needs twenty API calls, filtering, retries, a loop, or several dependent operations, the design becomes expensive: