
It’s value noting that each OpenAI and Anthropic open-source their coding CLI purchasers on GitHub, permitting builders to look at the implementation straight, whereas they don’t do the identical for ChatGPT or the Claude internet interface.
An official look contained in the loop
Bolin’s publish focuses on what he calls “the agent loop,” which is the core logic that orchestrates interactions between the person, the AI mannequin, and the software program instruments the mannequin invokes to carry out coding work.
As we wrote in December, on the middle of each AI agent is a repeating cycle. The agent takes enter from the person and prepares a textual immediate for the mannequin. The mannequin then generates a response, which both produces a remaining reply for the person or requests a instrument name (resembling working a shell command or studying a file). If the mannequin requests a instrument name, the agent executes it, appends the output to the unique immediate, and queries the mannequin once more. This course of repeats till the mannequin stops requesting instruments and as an alternative produces an assistant message for the person.
That looping course of has to start out someplace, and Bolin’s publish reveals how Codex constructs the preliminary immediate despatched to OpenAI’s Responses API, which handles mannequin inference. The immediate is constructed from a number of parts, every with an assigned position that determines its precedence: system, developer, person, or assistant.
The directions subject comes from both a user-specified configuration file or base directions bundled with the CLI. The instruments subject defines what features the mannequin can name, together with shell instructions, planning instruments, internet search capabilities, and any customized instruments supplied via Mannequin Context Protocol (MCP) servers. The enter subject incorporates a sequence of things that describe the sandbox permissions, non-obligatory developer directions, setting context like the present working listing, and eventually the person’s precise message.