SNAPSHOT · TIER B · CLI

Codex source@89a335e

Clean source inspection pinned to one public commit. The snapshot does not claim that every hosted Codex surface runs this exact revision, and it has not yet earned Tier A because no native experiment is attached.

codex-2026-08-10-sourcecurrent7 claims
Evidence boundary

Source claims are pinned to commit 89a335ed5025; product behavior still requires independent experiments.

looppartial
contextpartial
toolspartial
safetypartial
reliabilityunknown
extensibilitypartial
orchestrationpartial
interfacesunknown
observabilitypartial

Codex CLI core source map

This page is pinned to commit 89a335e. It describes the published Rust core; it does not prove that a hosted surface runs this commit and is not a substitute for a native experiment.

Turn input
  → context / skills / plugins / hooks
  → model sampling
  → assistant item or tool calls
  → ToolRouter → ToolRegistry → approval → sandbox → runtime
  → tool results + pending steering
  → follow-up sample / compaction / stop

1. Loop

run_turn owns the core loop for one user turn, while RegularTask::run checks the input queue after it returns. Sampling continues for tool follow-up, user steering, or mailbox delivery; otherwise stop hooks run and the turn ends. Claim: codex-source-agent-loop.

2. Context

Before the first sample, the core captures step context, records world state, and injects skills/plugins. It recomputes token state after sampling and can choose local or remote compaction before resuming a turn that still has work. Compaction replaces history and must not be described as lossless memory. Claim: codex-source-auto-compaction.

3. Tools

ToolRouter owns model-visible specifications; ToolRegistry owns runtimes and exposure. Reserved external names and collisions have explicit handling before a parsed call is resolved to a runtime. This creates two review points: what the model sees and what the host can execute. Claim: codex-source-tool-router.

4. Safety

Approval and sandboxing are separate layers. The approval path can forbid, ask, or skip; the sandbox path transforms and executes an attempt. The existence of this source boundary does not prove that an OS sandbox was active in an observed run, so the environment remains source-mapped. Claim: codex-source-execution-policy.

5. Reliability

The turn code includes cancellation, error events, token-limit rollover, and reuse of a turn-scoped client session across retries. These have not yet been isolated into fault-injection experiments and reviewed claims. Status: partial / experiment missing.

6. Extensibility

Turn assembly can inject skills and plugins. The hook runtime exposes typed boundaries around session start, pre/post tool use, permission requests, stop, compaction, and session end. Because extensions can affect control flow, they are also part of the trust boundary. Claim: codex-source-extension-runtime.

7. Orchestration

Multi-agent tools and agent control are separated: tool handlers receive model requests while the control layer owns child spawn and lifecycle. Concurrency, isolation, and cancellation behavior remain untested. Claim: codex-source-subagent-routing.

8. Interfaces

The CLI core and App Server are different surfaces. JSON-RPC and transport claims live in a separate snapshot so server protocol is not mistaken for CLI user behavior.

9. Observability

The protocol defines typed events for turns, items, tools, approvals, hooks, compaction, and collaboration, and the turn sends events through the session boundary. No publishable native trace exists yet, so replay fidelity remains unknown. Claim: codex-source-event-stream.

Result and gaps

This snapshot is sufficient for comparing source organization and control boundaries, but remains Tier B. Tier A requires at least a version-pinned native run, a redacted trace, a formal experiment, reviewed coverage across the nine dimensions, and external reproduction.

PINNED SOURCE MAP

github.com/openai/codex

89a335ed50258dc9dc5b3d7f410db61b431244f9
  • codex-rs/core/src/session/turn.rs
  • codex-rs/core/src/tasks/regular.rs
  • codex-rs/core/src/tools/registry.rs
  • codex-rs/core/src/tools/router.rs
  • codex-rs/core/src/tools/approvals.rs
  • codex-rs/core/src/tools/sandboxing.rs
  • codex-rs/core/src/compact.rs
  • codex-rs/core/src/hook_runtime.rs
  • codex-rs/core/src/tools/handlers/multi_agents_v2/spawn.rs
  • codex-rs/core/src/agent/control/spawn.rs
  • codex-rs/protocol/src/protocol.rs
CLAIM LEDGER7 REVIEWED · 0 DISPUTED
source + sourcereviewed

codex-source-agent-loop

At the pinned Codex source revision, run_turn repeatedly samples the model, executes requested function calls, feeds results into later samples, accepts steering input, and stops when follow-up work is no longer required or a stop/error path wins.

Mechanism
Agent Loop
Reviewed
2026-08-10
Sources
2
source + sourcereviewed

codex-source-event-stream

The pinned Codex protocol defines typed events for turn lifecycle, streamed content, tools, approvals, compaction, hooks, and collaborative-agent activity, and the turn implementation emits those events through the session boundary.

Mechanism
Event Stream
Reviewed
2026-08-10
Sources
2
source + sourcereviewed

codex-source-tool-router

The pinned Codex core separates model-visible tool specifications in ToolRouter from runtime registration and collision handling in ToolRegistry, then resolves each parsed call to its registered runtime.

Mechanism
Tool Dispatch
Reviewed
2026-08-10
Sources
2