跳至主要内容

Agent Harness 深度指南

用 Codex、DeepSeek Harness 與 Pi 三套完整開源 case study,看懂 Productized Runtime、Composable Framework 與 Minimal Harness 三種架構答案。

三套都從 Model / Loop / Context / Tools / State / Security / Extensions / Integration / Production 讀到底,不再把任何一套當附錄。

先理解責任,再比較實作

真正的差異不是「哪套有更多功能」,而是 Model、Tools、State、Security、Extensions 與 Client responsibilities 被放在哪一層,以及最後由誰維護。

1

Model

理解、推理、提出下一步

2

Harness

組 Context、驅動 Loop、協調狀態與事件

3

Capabilities

Tools、Files、Shell、APIs、Extensions

4

Execution & Policy

OS、Sandbox、Network、Credentials、Trust

最重要的一句:Codex 偏 Productized Runtime、DeepSeek 偏 Composable Runtime、Pi 偏 Minimal Runtime;三套都是完整 Harness,只是 responsibility boundary 不同。

三套同等深度,依問題自由切入

你可以從共同基礎開始依序讀三套,也可以先選自己最關心的 Harness,再回到比較章用共同維度校正理解。

共同基礎

先建立 vendor-neutral 的 Model、Harness、Agent Loop、Context、Tools、State 與 Policy 心智模型。

閱讀這一章 →

Codex|Productized Runtime

從 codex-core、Thread / Turn / Item、Tool Execution 到 Sandbox、Skills、App Server,完整看一套產品化 Coding Runtime。

閱讀這一章 →

DeepSeek|Composable Runtime

從 Cordis、Model / Loop、Tool Pipeline、SessionEvent 到 Plugins、Execution World、SDK 與 Replay。

閱讀這一章 →

Pi|Minimal Runtime

從 pi-ai、pi-agent-core、AgentSession、JSONL Session Tree 到 Resources、Extensions、RPC 與 Governance。

閱讀這一章 →

三套 Harness Labs

用 Trace、Extension / Plugin、Replay / Branch 等實驗直接觀察三套 runtime 的 architecture behavior。

閱讀這一章 →

架構逐項比較

用 Runtime、Context、State、Tools、Extensions、Security、Integration、Ownership Cost 比較三套。

閱讀這一章 →

情境式選型

把 Coding Agent、Embedded App、Agent Platform、Security、Research 等需求映射到不同 architecture。

閱讀這一章 →

真實系統與 Production

把三套抽象回 Workflow、Behavior Placement、自製 Harness 與 Production Checklist。

閱讀這一章 →

三套原始碼導讀

從責任邊界開始讀 openai/codex、deepseek-ai/deepseek-harness 與 earendil-works/pi。

閱讀這一章 →