中文

Architecture, Patterns, Internals

Codex From Source: read Codex as a system.

A source-pinned architecture book that explains Codex as an event-sourced agent runtime with typed contracts, policy-gated tools, replayable state, multiple clients, extensions, cloud workflows, and executable governance.

Codex From Source as a bounded agent runtime with entry points, protocol, session runtime, tools, clients, and governance
Codex is best read as one bounded agent runtime: entry points, typed protocol, session runtime, tools and policy, clients, and governance.
01

Contracts first

Start with operations, events, threads, turns, and items before reading UI code.

02

Runtime spine

Follow session state, turn scheduling, provider streaming, and rollout trace as one loop.

03

Side effects

Read tools, shell, patches, approvals, hooks, sandboxes, and network policy as one authority stack.

04

Surfaces and governance

Finish with app-server, SDKs, TUI, extensions, cloud tasks, release, and CI.

Source-Grounded

The book is designed so readers can understand architecture, data flow, contracts, and trade-offs before opening the pinned source links.

Publication-Grade

Chapters are organized as a technical book: each layer solves one problem and prepares the next.

Source-Pinned

All source links point to 569ff6a1c400bd514ff79f5f1050a684dc3afde3, so auditability does not depend on branch state.

Table of contents

Reference pages