pub enum TrajectoryPayload {
RunStarted {
identity: RunIdentity,
},
RunEnded {
outcome: String,
new_messages: Vec<AgentMessage>,
},
TurnStarted,
TurnEnded {
assistant: AgentMessage,
tool_results: Vec<AgentMessage>,
},
MessageAppended {
message: AgentMessage,
},
ToolStarted {
tool_call_id: String,
tool_name: String,
args: Value,
},
ToolEnded {
tool_call_id: String,
tool_name: String,
result: ToolResult,
is_error: bool,
},
ProviderRequestPrepared {
iteration: usize,
model_id: Option<String>,
system_prompt_chars: usize,
message_count: usize,
tool_count: usize,
tools: Vec<String>,
},
ContextTransformApplied {
iteration: usize,
plugin: String,
before_count: usize,
after_count: usize,
},
ToolGateApplied {
iteration: usize,
plugin: String,
allow: Option<Vec<String>>,
},
ToolGateConflictResolved {
iteration: usize,
plugins: Vec<String>,
chosen_plugin: Option<String>,
allow: Vec<String>,
reason: String,
},
OutputTokensEscalation {
attempt: u8,
prev_cap: u32,
new_cap: u32,
},
}Expand description
Typed payload of a trajectory record. The variants are a curated
subset of AgentEvent — the things a replay or eval actually
needs. Streaming-only events (MessageUpdate, ToolExecutionUpdate)
are intentionally omitted; they belong on the streaming channel.
Variants§
RunStarted
Fields
identity: RunIdentityRunEnded
TurnStarted
TurnEnded
MessageAppended
Messages appended to the transcript (user, assistant, or tool result). Final form only — no streaming deltas.
Fields
message: AgentMessageToolStarted
ToolEnded
ProviderRequestPrepared
One LLM call’s request snapshot, post-transform and post-gate. Captures the typed view of “what the model saw this turn.”
Fields
ContextTransformApplied
A ContextTransform plugin ran. Carries only the plugin name
and the before/after message counts so durable trajectories
stay compact; the full diff stays on the streaming channel for
listeners that want it.
ToolGateApplied
A ToolGate plugin contributed an allowlist for this turn.
ToolGateConflictResolved
The final intersected allowlist would have been empty, so the loop selected a deterministic owner allowlist instead of advertising zero tools to the provider.
Fields
OutputTokensEscalation
The loop discarded a truncated turn and re-streamed.
Trait Implementations§
Source§impl Clone for TrajectoryPayload
impl Clone for TrajectoryPayload
Source§fn clone(&self) -> TrajectoryPayload
fn clone(&self) -> TrajectoryPayload
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more