Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

OpenAI 14 min read Case study mediumAdept

Unlocking the Codex harness: how we built the App Server

The Codex App Server is a bidirectional JSON-RPC protocol over stdio (JSONL), plus a long-lived process that hosts Codex core threads. It exposes one agent harness to the CLI, VS Code, the desktop app, web, and partners such as JetBrains and Xcode. It grew out of a VS Code integration after exposing Codex as an MCP server proved awkward. The protocol is built on three primitives: items (with started, delta and completed lifecycles), turns and persisted threads. It adds an initialize handshake for versioning and server-initiated approval requests that pause a turn. Clients run it as a pinned child process locally or inside containers for Codex Web, rely on backward compatibility to upgrade the server independently, and can generate TypeScript types or a JSON Schema from the Rust protocol.

Related posts

  • Harness engineering: leveraging Codex in an agent-first world

    OpenAI mediumAdept

    A small OpenAI team built and shipped an internal product of roughly a million lines over five months with zero manually written code, merging about 1,500 Codex-authored PRs at around 3.5 PRs per engineer per day, an estimated 10x faster than writing it by hand. The engineers' job shifted to building the environment agents work in. Each git worktree boots its own app instance, the Chrome DevTools Protocol lets agents drive the UI, and a per-worktree ephemeral observability stack can be queried with LogQL, PromQL and TraceQL. A short AGENTS.md acts as a map into a structured, CI-validated docs/ directory instead of one giant instruction file. A rigid layered domain architecture is enforced by custom linters whose error messages carry remediation instructions for the agent.

  • Unrolling the Codex agent loop

    OpenAI mediumAdept

    Codex CLI's agent loop repeatedly sends a prompt to the Responses API, executes any tool calls the model requests, and appends their outputs until the model returns an assistant message that ends the turn. The initial prompt is assembled from three parts: instructions from config or bundled model files, a tools list (shell, update_plan, web_search, MCP tools), and ordered input items. Those input items cover sandbox permissions, developer instructions, aggregated AGENTS.md user instructions (32 KiB limit), skills and environment context. Responses stream back as SSE events, and reasoning and function-call items are fed back into later requests, so prompt length grows and context-window management becomes a core harness responsibility.

  • Building the Agent Host Protocol for sessions that continue across devices

    GitHub Engineering mediumAdept

    The Agent Host Protocol (AHP) is an open standard that lets multiple clients (VS Code, the Copilot app, mobile apps, custom tools) share the same long-running agent sessions, so work started on one device can continue on another. It is organized around URI-identified channels (required root, session and chat channels, plus optional terminal, MCP and telemetry channels), each holding server-arbitrated reducer-based state that clients mutate by dispatching actions. This makes reconnection and replay over flaky networks straightforward and fits UI frameworks like React. Two independent hosts, VS Code's in TypeScript and GitHub's in Rust, exposed protocol gaps such as non-PTY shell output and client assumptions about session URI structure, and libraries now exist in six languages.

  • Four minutes after midnight, Codex said the page was live

    Render mediumAdept

    OpenAI's Dominik Kundel argues that with agentic delegation, code is no longer the bottleneck. What matters is the harness around the agent: context, validation and verification. Codex reaches context through plugins (Slack, Notion, Drive, Linear), Memories and Chronicle. It validates its own work with fast tests, linters like Vale for docs, parallel app copies, CDP debugging and deployment-watching plugins. Changes get verified by a separate Codex review session tuned via AGENTS.md to flag only P0/P1 issues, plus deploy previews or videos. Recurring feedback should become skills, lint rules or tests rather than repeated corrections, illustrated by Codex shepherding a midnight docs deploy end to end.

  • How two engineer side projects became the agent taking action inside Dropbox

    Dropbox Tech mediumAdept

    Dropbox's file-acting agent grew out of two engineer prototypes, a server-side sandbox with installed software and a desktop chat UI with permission controls, merged into one system. Each conversation gets a fresh VM restored from a QEMU memory snapshot via the Riviera content-processing platform, with Dropbox files mounted through rclone. The VM has no general internet access, and all outbound requests go through a proxy to host_tools outside the VM, which checks destinations, operations and user-granted folder permissions before attaching credentials. The UI speaks the Codex App Server JSON-RPC protocol (threads, turns, items), and an adapter lets the Pi harness reuse it. Every agent-made file version is tagged with its conversation so a turn can be undone precisely, with conflicting edits saved as renamed copies. 75% of workspaces are ready within 300 ms, and tools sit on a separate virtual disk so the snapshot needn't be rebuilt.

The quest for software engineering knowledge.

Look:
Layout: