pub enum RuntimeEvent {
TextDelta {
session_id: SessionId,
text: String,
agent_id: Option<String>,
trace_id: Option<String>,
},
ThoughtDelta {
session_id: SessionId,
text: String,
agent_id: Option<String>,
trace_id: Option<String>,
},
ActionDraft {
session_id: SessionId,
index: usize,
name: String,
args_len: usize,
count: usize,
agent_id: Option<String>,
trace_id: Option<String>,
},
ActionStarted {
session_id: SessionId,
tool_name: String,
args_json: String,
agent_id: Option<String>,
trace_id: Option<String>,
},
ActionFinished {
session_id: SessionId,
tool_name: String,
summary: String,
agent_id: Option<String>,
trace_id: Option<String>,
denied: bool,
details: Option<Value>,
},
AwaitingApproval {
session_id: SessionId,
request: ApprovalRequest,
agent_id: Option<String>,
trace_id: Option<String>,
},
Checkpoint {
session_id: SessionId,
checkpoint: Box<CheckpointData>,
agent_id: Option<String>,
trace_id: Option<String>,
},
RunFinished {
session_id: SessionId,
agent_id: Option<String>,
trace_id: Option<String>,
},
RunCancelled {
session_id: SessionId,
agent_id: Option<String>,
trace_id: Option<String>,
},
PlanUpdated {
session_id: SessionId,
objective: String,
explanation: Option<String>,
plan: Vec<PlanItem>,
agent_id: Option<String>,
trace_id: Option<String>,
},
UserEvent {
session_id: SessionId,
event: UserEvent,
agent_id: Option<String>,
trace_id: Option<String>,
},
}Expand description
Unified runtime event — the single event type for both internal and external consumers (frontends, CLIs, tests).
Variants§
TextDelta
Fields
ThoughtDelta
ActionDraft
A tool call that is still being streamed into existence.
Tool-call arguments arrive as fragments and are only materialized into
a RuntimeEvent::ActionStarted once the whole turn’s stream is
drained — multi-KB arguments (a spawn_agent task brief) are invisible
to every consumer until then. This event makes that window observable:
coarse progress on the call being drafted (index), enough for a UI to
say “writing tool calls” instead of looking hung. It carries no
argument text, only a size, and is throttled at the source.
Fields
ActionStarted
Fields
ActionFinished
Fields
AwaitingApproval
Fields
request: ApprovalRequestCheckpoint
Fields
checkpoint: Box<CheckpointData>Boxed so the announcement event stays small on the hot path (every RuntimeEvent copy is as big as its largest variant).
RunFinished
RunCancelled
PlanUpdated
Fields
UserEvent
A user-space event produced by a tool.
Implementations§
Source§impl RuntimeEvent
impl RuntimeEvent
Sourcepub fn session_id(&self) -> &SessionId
pub fn session_id(&self) -> &SessionId
Get the session ID associated with this event.
Sourcepub fn with_agent_id(self, id: impl Into<String>) -> Self
pub fn with_agent_id(self, id: impl Into<String>) -> Self
Set the agent ID (sub-agent path) on this event.