Skip to main content

Crate codex_rollout_trace

Crate codex_rollout_trace 

Source
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§

AgentMessageMetadata
Public reduced trace model returned by replay. Sender and destination identities attached to a model-visible agent message.
AgentResultTracePayload
Raw payload captured when a child agent reports completion to its parent. Trace-only payload for a child completion notification delivered to its parent.
AgentThread
Public reduced trace model returned by replay. One Codex thread/session participating in the rollout.
CodeCell
Public reduced trace model returned by replay. Runtime/debug object for one model-authored exec cell.
CodeCellTraceContext
No-op-capable handle for recording one code-mode runtime cell. No-op capable trace handle for one code-mode runtime cell.
CodexTurn
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.
CompactionCheckpointTracePayload
Raw checkpoint payload for a remote compaction install event. History replacement checkpoint persisted when compaction installs new live history.
CompactionRequest
Public reduced trace model returned by replay. One upstream remote request made while computing a compaction checkpoint.
CompactionTraceAttempt
No-op-capable handle for recording remote-compaction requests. One upstream request attempt made while computing a compaction checkpoint.
CompactionTraceContext
Shared recorder context for a compaction checkpoint. Turn-local remote compaction tracing context.
ConversationBody
Public reduced trace model returned by replay. Ordered content parts for a reduced conversation item.
ConversationItem
Public reduced trace model returned by replay. One logical transcript item or transcript boundary.
ExecutionWindow
Public reduced trace model returned by replay. Runtime interval for a typed trace object.
InferenceCall
Public reduced trace model returned by replay. One outbound inference request and its response metadata.
InferenceTraceAttempt
No-op-capable handle for recording one upstream inference attempt. One concrete upstream request attempt.
InferenceTraceContext
Shared recorder context for inference attempts within one Codex turn. Turn-local inference tracing context.
InteractionEdge
Public reduced trace model returned by replay. Directed information-flow relationship between trace objects.
McpCallTraceContext
Trace-owned MCP execution correlation propagated to bridge request metadata. No-op capable handle for one concrete MCP backend call.
RawPayloadRef
Reference to a raw request/response/log payload stored in the bundle. Reference to a raw request/response/log payload.
RawTraceEvent
One append-only raw trace event from trace.jsonl. One append-only raw trace event.
RawTraceEventContext
Event-envelope context supplied by hot-path trace producers. Writer-supplied context that appears in the raw event envelope.
RolloutTrace
Public reduced trace model returned by replay. Canonical reduced graph for one Codex rollout.
TerminalModelObservation
Public reduced trace model returned by replay. Conversation items that observed a terminal operation.
TerminalOperation
Public reduced trace model returned by replay. One command/write/poll operation against a terminal session.
TerminalResult
Public reduced trace model returned by replay. Terminal result observed by the runtime.
TerminalSession
Public reduced trace model returned by replay. Reusable terminal process/session returned by the runtime.
ThreadStartedTraceMetadata
Raw metadata captured when a thread starts. Metadata captured once at thread/session start.
ThreadTraceContext
No-op-capable handle for recording one thread in a rollout bundle. No-op capable trace handle for one thread in a rollout bundle.
TokenUsage
Public reduced trace model returned by replay. Token usage summary for one inference call.
ToolCall
Public reduced trace model returned by replay. Runtime operation requested by the model, a JS code cell, or Codex itself.
ToolDispatchInvocation
Request data for the canonical Codex tool boundary. Core-facing request data for the canonical Codex tool boundary.
ToolDispatchTraceContext
No-op-capable handle for recording one resolved tool dispatch. No-op capable trace handle for one resolved tool dispatch.
TraceWriter
Append-only writer used by hot-path Codex instrumentation. Local trace bundle writer.

Enums§

AgentOrigin
Public reduced trace model returned by replay. Provenance for a traced Codex thread.
CodeCellRuntimeStatus
Public reduced trace model returned by replay. Code-mode runtime lifecycle.
ConversationChannel
Public reduced trace model returned by replay. Codex channel for model-visible content.
ConversationItemKind
Public reduced trace model returned by replay. Responses item category after normalization into the reduced transcript.
ConversationPart
Public reduced trace model returned by replay. One model-visible part inside a conversation item.
ConversationRole
Public reduced trace model returned by replay. Model-visible role assigned to a conversation item.
ExecutionStatus
Public reduced trace model returned by replay. Coarse lifecycle status for a runtime object.
InteractionEdgeKind
Public reduced trace model returned by replay. Information-flow edge category.
ProducerRef
Public reduced trace model returned by replay. Explanation for where a conversation item came from.
RawPayloadKind
Coarse role labels for raw payload files. Coarse role of a raw payload.
RawToolCallRequester
Runtime requester observed before semantic reduction. Runtime requester as observed at the raw tool boundary.
RawTraceEventPayload
Typed payload for one raw trace event. Typed payload for a raw trace event.
RolloutStatus
Public reduced trace model returned by replay. Coarse terminal status for the rollout.
TerminalObservationSource
Public reduced trace model returned by replay. Source of model-visible terminal observation.
TerminalOperationKind
Public reduced trace model returned by replay. Terminal operation category.
TerminalRequest
Public reduced trace model returned by replay. Terminal request summary.
ToolCallKind
Public reduced trace model returned by replay. Runtime tool category.
ToolCallRequester
Public reduced trace model returned by replay. Requester of a runtime tool.
ToolCallSummary
Public reduced trace model returned by replay. Bounded card/list summary for a tool call.
ToolDispatchPayload
Tool input observed at the registry boundary. Tool input observed at the registry boundary.
ToolDispatchRequester
Runtime source that caused a dispatch-level tool call. Runtime source that caused a dispatch-level tool call.
ToolDispatchResult
Result data returned from a dispatch-level tool call. Result data returned from a dispatch-level tool call.
TraceAnchor
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 RolloutTrace cache.

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§

AgentPath
Public reduced trace model returned by replay. Stable multi-agent routing path such as /root or /root/search_docs.
AgentThreadId
Public reduced trace model returned by replay. Codex conversation/session UUID.
CodeCellId
Public reduced trace model returned by replay. Reducer-owned ID for one model-authored exec JavaScript cell.
CodeModeRuntimeToolId
Public reduced trace model returned by replay. Tool invocation ID assigned inside the code-mode JavaScript runtime.
CodexTurnId
Public reduced trace model returned by replay. Runtime submission/activation UUID. This is not a chat turn.
CompactionId
Public reduced trace model returned by replay. Reducer-owned ID for one installed conversation-history checkpoint.
CompactionRequestId
Public reduced trace model returned by replay. Reducer-owned ID for one upstream request that computes a compaction.
ConversationItemId
Public reduced trace model returned by replay. Reduced transcript item ID assigned by the trace reducer.
CorrelationId
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.
InferenceCallId
Public reduced trace model returned by replay. Local ID for one outbound upstream inference request.
McpCallId
Public reduced trace model returned by replay. Globally unique ID for one concrete MCP backend request.
ModelVisibleCallId
Public reduced trace model returned by replay. Responses call_id / custom-tool call ID visible in inference payloads.
RawEventSeq
Monotonic sequence number assigned by the raw trace writer. Monotonic sequence number assigned by the raw trace writer.
RawPayloadId
Stable identifier for one raw payload inside a rollout bundle. Stable identifier for one raw payload inside a rollout bundle.
TerminalId
Public reduced trace model returned by replay. Process/session ID returned by Codex’s terminal runtime.
TerminalOperationId
Public reduced trace model returned by replay. Reducer-owned ID for one command/write/poll operation against a terminal.
ToolCallId
Public reduced trace model returned by replay. Reducer-owned ID for one runtime tool-call object.