Expand description
Trace bundle format, writer, and reducer for Codex rollouts.
This crate owns the trace schema. Hot-path Codex code should depend on the
small writer API here; semantic replay and viewer projections stay outside
codex-core.
See README.md for the system diagram and reducer model.
Structs§
- Agent
Message Metadata - Public reduced trace model returned by replay. Sender and destination identities attached to a model-visible agent message.
- Agent
Result Trace Payload - Raw payload captured when a child agent reports completion to its parent. Trace-only payload for a child completion notification delivered to its parent.
- Agent
Thread - Public reduced trace model returned by replay. One Codex thread/session participating in the rollout.
- Code
Cell - Public reduced trace model returned by replay.
Runtime/debug object for one model-authored
execcell. - Code
Cell Trace Context - No-op-capable handle for recording one code-mode runtime cell. No-op capable trace handle for one code-mode runtime cell.
- Codex
Turn - Public reduced trace model returned by replay. One activation of the Codex runtime for one thread.
- Compaction
- Public reduced trace model returned by replay. Installed conversation-history replacement boundary.
- Compaction
Checkpoint Trace Payload - Raw checkpoint payload for a remote compaction install event. History replacement checkpoint persisted when compaction installs new live history.
- Compaction
Request - Public reduced trace model returned by replay. One upstream remote request made while computing a compaction checkpoint.
- Compaction
Trace Attempt - No-op-capable handle for recording remote-compaction requests. One upstream request attempt made while computing a compaction checkpoint.
- Compaction
Trace Context - Shared recorder context for a compaction checkpoint. Turn-local remote compaction tracing context.
- Conversation
Body - Public reduced trace model returned by replay. Ordered content parts for a reduced conversation item.
- Conversation
Item - Public reduced trace model returned by replay. One logical transcript item or transcript boundary.
- Execution
Window - Public reduced trace model returned by replay. Runtime interval for a typed trace object.
- Inference
Call - Public reduced trace model returned by replay. One outbound inference request and its response metadata.
- Inference
Trace Attempt - No-op-capable handle for recording one upstream inference attempt. One concrete upstream request attempt.
- Inference
Trace Context - Shared recorder context for inference attempts within one Codex turn. Turn-local inference tracing context.
- Interaction
Edge - Public reduced trace model returned by replay. Directed information-flow relationship between trace objects.
- McpCall
Trace Context - Trace-owned MCP execution correlation propagated to bridge request metadata. No-op capable handle for one concrete MCP backend call.
- RawPayload
Ref - Reference to a raw request/response/log payload stored in the bundle. Reference to a raw request/response/log payload.
- RawTrace
Event - One append-only raw trace event from
trace.jsonl. One append-only raw trace event. - RawTrace
Event Context - Event-envelope context supplied by hot-path trace producers. Writer-supplied context that appears in the raw event envelope.
- Rollout
Trace - Public reduced trace model returned by replay. Canonical reduced graph for one Codex rollout.
- Terminal
Model Observation - Public reduced trace model returned by replay. Conversation items that observed a terminal operation.
- Terminal
Operation - Public reduced trace model returned by replay. One command/write/poll operation against a terminal session.
- Terminal
Result - Public reduced trace model returned by replay. Terminal result observed by the runtime.
- Terminal
Session - Public reduced trace model returned by replay. Reusable terminal process/session returned by the runtime.
- Thread
Started Trace Metadata - Raw metadata captured when a thread starts. Metadata captured once at thread/session start.
- Thread
Trace Context - No-op-capable handle for recording one thread in a rollout bundle. No-op capable trace handle for one thread in a rollout bundle.
- Token
Usage - Public reduced trace model returned by replay. Token usage summary for one inference call.
- Tool
Call - Public reduced trace model returned by replay. Runtime operation requested by the model, a JS code cell, or Codex itself.
- Tool
Dispatch Invocation - Request data for the canonical Codex tool boundary. Core-facing request data for the canonical Codex tool boundary.
- Tool
Dispatch Trace Context - No-op-capable handle for recording one resolved tool dispatch. No-op capable trace handle for one resolved tool dispatch.
- Trace
Writer - Append-only writer used by hot-path Codex instrumentation. Local trace bundle writer.
Enums§
- Agent
Origin - Public reduced trace model returned by replay. Provenance for a traced Codex thread.
- Code
Cell Runtime Status - Public reduced trace model returned by replay. Code-mode runtime lifecycle.
- Conversation
Channel - Public reduced trace model returned by replay. Codex channel for model-visible content.
- Conversation
Item Kind - Public reduced trace model returned by replay. Responses item category after normalization into the reduced transcript.
- Conversation
Part - Public reduced trace model returned by replay. One model-visible part inside a conversation item.
- Conversation
Role - Public reduced trace model returned by replay. Model-visible role assigned to a conversation item.
- Execution
Status - Public reduced trace model returned by replay. Coarse lifecycle status for a runtime object.
- Interaction
Edge Kind - Public reduced trace model returned by replay. Information-flow edge category.
- Producer
Ref - Public reduced trace model returned by replay. Explanation for where a conversation item came from.
- RawPayload
Kind - Coarse role labels for raw payload files. Coarse role of a raw payload.
- RawTool
Call Requester - Runtime requester observed before semantic reduction. Runtime requester as observed at the raw tool boundary.
- RawTrace
Event Payload - Typed payload for one raw trace event. Typed payload for a raw trace event.
- Rollout
Status - Public reduced trace model returned by replay. Coarse terminal status for the rollout.
- Terminal
Observation Source - Public reduced trace model returned by replay. Source of model-visible terminal observation.
- Terminal
Operation Kind - Public reduced trace model returned by replay. Terminal operation category.
- Terminal
Request - Public reduced trace model returned by replay. Terminal request summary.
- Tool
Call Kind - Public reduced trace model returned by replay. Runtime tool category.
- Tool
Call Requester - Public reduced trace model returned by replay. Requester of a runtime tool.
- Tool
Call Summary - Public reduced trace model returned by replay. Bounded card/list summary for a tool call.
- Tool
Dispatch Payload - Tool input observed at the registry boundary. Tool input observed at the registry boundary.
- Tool
Dispatch Requester - Runtime source that caused a dispatch-level tool call. Runtime source that caused a dispatch-level tool call.
- Tool
Dispatch Result - Result data returned from a dispatch-level tool call. Result data returned from a dispatch-level tool call.
- Trace
Anchor - Public reduced trace model returned by replay. Typed pointer to one stable reduced-trace object.
Constants§
- CODEX_
ROLLOUT_ TRACE_ ROOT_ ENV - Environment variable that enables local trace-bundle recording. Environment variable that enables local trace-bundle recording.
- REDUCED_
STATE_ FILE_ NAME - Conventional reduced-state cache name written next to a raw trace bundle.
Conventional file name for a reducer-written
RolloutTracecache.
Functions§
- replay_
bundle - Replay a raw trace bundle and write/read its reduced
RolloutTrace. Replays a local trace bundle into a reduced rollout graph.
Type Aliases§
- Agent
Path - Public reduced trace model returned by replay.
Stable multi-agent routing path such as
/rootor/root/search_docs. - Agent
Thread Id - Public reduced trace model returned by replay. Codex conversation/session UUID.
- Code
Cell Id - Public reduced trace model returned by replay.
Reducer-owned ID for one model-authored
execJavaScript cell. - Code
Mode Runtime Tool Id - Public reduced trace model returned by replay. Tool invocation ID assigned inside the code-mode JavaScript runtime.
- Codex
Turn Id - Public reduced trace model returned by replay. Runtime submission/activation UUID. This is not a chat turn.
- Compaction
Id - Public reduced trace model returned by replay. Reducer-owned ID for one installed conversation-history checkpoint.
- Compaction
Request Id - Public reduced trace model returned by replay. Reducer-owned ID for one upstream request that computes a compaction.
- Conversation
Item Id - Public reduced trace model returned by replay. Reduced transcript item ID assigned by the trace reducer.
- Correlation
Id - Public reduced trace model returned by replay. Reducer-owned ID for request/log correlation metadata.
- EdgeId
- Public reduced trace model returned by replay. Reducer-owned ID for one information-flow edge.
- Inference
Call Id - Public reduced trace model returned by replay. Local ID for one outbound upstream inference request.
- McpCall
Id - Public reduced trace model returned by replay. Globally unique ID for one concrete MCP backend request.
- Model
Visible Call Id - Public reduced trace model returned by replay.
Responses
call_id/ custom-tool call ID visible in inference payloads. - RawEvent
Seq - Monotonic sequence number assigned by the raw trace writer. Monotonic sequence number assigned by the raw trace writer.
- RawPayload
Id - Stable identifier for one raw payload inside a rollout bundle. Stable identifier for one raw payload inside a rollout bundle.
- Terminal
Id - Public reduced trace model returned by replay. Process/session ID returned by Codex’s terminal runtime.
- Terminal
Operation Id - Public reduced trace model returned by replay. Reducer-owned ID for one command/write/poll operation against a terminal.
- Tool
Call Id - Public reduced trace model returned by replay. Reducer-owned ID for one runtime tool-call object.