Codex Source Notes

Codex Source Notes

This series reads openai/codex by following one ordinary request: how it becomes a typed operation, enters session and turn ownership, projects context, exposes tools, narrows authority, and leaves evidence that clients, recovery paths, the memory layer, and platform sandboxes can reuse.

The English pages are standalone articles, not route stubs. Source claims are tied to a fixed openai/codex public snapshot; product contracts come from OpenAI documentation.

Source Notes · Part I Follow One Turn Through Codex

Establish the route first: entry, typed protocol, session, turn, context, model stream, tool authority, and evidence projection.

Source Notes · Part II Context Is a Runtime Ledger

Separate runtime context, prompt projection, compaction replacement, rollout persistence, rollback, and resume boundaries.

Source Notes · Part III Protocol and Event Stream

Follow typed requests, submissions, operations, events, app-server projection, rollout, and resume as one shared evidence layer.

Source Notes · Part IV Tools Are Runtime Contracts

Read how tool specs, routing, registry hooks, invocations, approval, sandboxing, events, and history stay separated.

Source Notes · Part V Permission and Sandboxing

Follow policy, permission hooks, orchestrator decisions, sandbox attempts, approvals, denial, retry, and structured review events.

Source Notes · Part VI Client Projection

Separate core events, turn items, thread items, server notifications, TUI cells, and rollout evidence.

Source Notes · Part VII Extensions and Multi-Agent

Read how skills, plugins, MCP tools, dynamic tools, tool discovery, and agent control enter the same turn boundary.

Source Notes · Part VIII Hooks and Lifecycle Slots

Place hook discovery, prompt gates, tool gates, permission requests, compact, stop, and protocol events back into the turn lifecycle.

Source Notes · Part IX Performance and Prompt Cache

Tie the OpenAI caching contract, cache keys, stable prefixes, dynamic tails, compaction, and token metrics into one request-shape story.

Source Notes · Part X Rollout and Recovery

Follow rollout items, JSONL writes, initial history, reverse scan, replay suffix, rollback markers, and fork snapshots.

Source Notes · Part XI SDK and app-server

Read app-server initialization, typed client requests, thread/start, turn/start, listener projection, and SDK wrappers as one runtime entry path.

Source Notes · Part XII Memory Layer

Read Feature::MemoryTool, memory_mode, Phase 1 / Phase 2, the memories workspace, read path, citation, and polluted threads as one local recall layer.

Source Notes · Part XIII Windows Sandbox

Follow SandboxAttempt, sandbox users, ACLs, firewall rules, command runner, and restricted tokens as the Windows local execution boundary.