视频 · AI Engineer

拆解 Codex Harness:让长程智能体可靠运行的工程设计

原题:Codex, Behind the Harness — Dominik Kundel, OpenAI

AI Engineer2 分钟
内容摘要这场技术演讲以开源 Codex harness 为例,说明协议设计、上下文管理、异步协作、安全审查、传输机制与压缩策略如何让长时间运行的智能体真正可用。

Codex, Behind the Harness

Dominik Kundel’s talk is a compact engineering tour of the Codex harness: the layer that turns a model into an agent experience. His core point is that the harness is open source and can be studied, extended, or used as a blueprint by teams building their own agent interfaces.

The architecture begins with two protocols. The app server carries requests from a user interface into the harness. The Responses API handles communication from the harness to model inference and exposes capabilities needed by agents, including tool use. Kundel stresses that both layers are designed for an open ecosystem, so compatible UIs, harnesses, and model providers can participate.

Much of the practical work is context construction. A harness has to balance context size, flexibility, and cacheability. Codex uses deferred tools and tool search so that rarely needed tool descriptions do not consume the initial context window. The talk then moves through the actions that make an agent useful: asynchronous subagents, background work, browser control through a persistent Node environment, and filesystem changes made through tools such as an apply-patch workflow.

Safety and speed are recurring constraints. Sandbox layers mediate filesystem actions, while auto review uses a separate read-only subagent to assess authorization and risk for sensitive actions. As models become faster, network overhead can become a bottleneck; a persistent WebSocket mode reduces repeated data transfer by sending changed information and tool results incrementally.

Finally, Kundel explains goal loops and compaction. A continuation prompt keeps the objective present until the model reports completion through an update tool, which is why concrete and verifiable goals matter. For long-running agents, automatic server-side compaction preserves the useful context in a new window. The closing takeaway is straightforward: learn from the open-source app server and harness, use the Responses API capabilities directly where they fit, and keep adapting as the models and platform evolve.