OpenAI spills technical particulars about how its AI coding agent works
It’s value noting that each OpenAI and Anthropic open-source their coding CLI shoppers on GitHub, permitting builders to look at the implementation immediately, whereas they don’t do the identical for ChatGPT or the Claude net 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 closing reply for the person or requests a software name (comparable to operating a shell command or studying a file). If the mannequin requests a software 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 a substitute produces an assistant message for the person.
That looping course of has to begin 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 area comes from both a user-specified configuration file or base directions bundled with the CLI. The instruments area defines what capabilities the mannequin can name, together with shell instructions, planning instruments, net search capabilities, and any customized instruments offered by means of Mannequin Context Protocol (MCP) servers. The enter area accommodates a sequence of things that describe the sandbox permissions, non-compulsory developer directions, setting context like the present working listing, and at last the person’s precise message.