codex_rollout_trace/payload.rs
1//! References to heavyweight trace payloads stored outside the reduced graph.
2
3use serde::Deserialize;
4use serde::Serialize;
5
6/// Stable identifier for one raw payload inside a rollout bundle.
7pub type RawPayloadId = String;
8
9/// Reference to a raw request/response/log payload.
10///
11/// `RolloutTrace` stores these references so normal timeline and conversation
12/// rendering does not require the browser or reducer output to inline every
13/// upstream request, tool response, or terminal log.
14#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
15pub struct RawPayloadRef {
16 pub raw_payload_id: RawPayloadId,
17 /// Payload role. This lets details UI choose syntax highlighting and labels
18 /// without opening the payload file first.
19 pub kind: RawPayloadKind,
20 /// Path relative to the trace bundle root.
21 ///
22 /// The writer always materializes payloads as bundle-local files. Keeping
23 /// this as a plain path avoids exposing storage modes we do not produce.
24 pub path: String,
25}
26
27/// Coarse role of a raw payload.
28#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize)]
29#[serde(rename_all = "snake_case", tag = "type", content = "value")]
30pub enum RawPayloadKind {
31 InferenceRequest,
32 /// Full upstream inference response or non-delta response stream summary.
33 InferenceResponse,
34 CompactionRequest,
35 /// Trace-only checkpoint captured when processed replacement history is installed.
36 CompactionCheckpoint,
37 CompactionResponse,
38 ToolInvocation,
39 ToolResult,
40 /// Raw runtime/protocol observation for an executing tool.
41 ToolRuntimeEvent,
42 /// Raw terminal runtime event or stream shard.
43 TerminalRuntimeEvent,
44 ProtocolEvent,
45 /// One-shot metadata captured when a Codex session/thread starts.
46 SessionMetadata,
47 /// Runtime notification payload carried when a child agent reports back to its parent.
48 AgentResult,
49}