9 min read
|
Saved February 14, 2026
|
Copied!
Do you care about this?
This article explains the architecture and functionality of the Codex App Server, which powers various Codex applications. It details the agent loop, conversation primitives, and how developers can integrate Codex into their products effectively.
If you do, here's more
OpenAI's Codex exists in various forms, including a web app, CLI, IDE extension, and a macOS app, all driven by the same Codex harness. The Codex App Server is the backbone, providing a bidirectional JSON-RPC API that connects these different surfaces. The article outlines how this platform was developed in response to growing demand from both internal teams and partners like JetBrains and Xcode, who wanted to embed Codex's capabilities into their own products. The design had to prioritize ease of integration and backward compatibility, allowing for future protocol evolution without disrupting existing clients.
The Codex harness includes a core agent loop that manages user interactions through a series of threads, which represent conversations between users and agents. Each thread is capable of persisting event history, allowing clients to reconnect and maintain a consistent timeline. The harness also incorporates tool execution and integration with various services, managing these interactions under a unified policy model. The Codex core codebase contains the logic necessary for running these threads and managing their persistence.
The App Server operates as a long-lived process hosting Codex core threads. It features several components, such as a message processor and a thread manager, which work together to handle client requests and server notifications. This structure allows for detailed event updates, enriching the user interface. Communication between the client and server is not straightforward request/response; instead, it involves a series of conversation primitives—items and turns—that represent user inputs and agent responses. These primitives are designed to facilitate real-time updates, allowing for a smoother interaction experience.
Questions about this article
No questions yet.