pub enum RpcEvent {
MessageUpdate {
event: AssistantEvent,
},
SubagentStart {
subagent_id: u64,
agent_name: String,
task_preview: String,
},
SubagentUpdate {
subagent_id: u64,
agent_name: String,
status: String,
},
SubagentDone {
subagent_id: u64,
agent_name: String,
result_preview: String,
duration_secs: f64,
},
AgentEnd {
usage: TurnUsage,
},
Response {
id: String,
command: String,
body: Value,
},
Error {
id: Option<String>,
message: String,
},
Ready {
session_id: String,
model: String,
protocol_version: u32,
},
}Expand description
Events emitted by the rpc child to the parent over the child’s
stdout.
Variants§
MessageUpdate
A streaming update from the assistant (text delta, thinking, tool
call lifecycle, …). One or more of these frames precede each
RpcEvent::AgentEnd.
Fields
event: AssistantEventThe granular assistant event payload.
SubagentStart
A subagent has been spawned to handle a delegated task.
Fields
SubagentUpdate
A running subagent has produced an intermediate status update.
Fields
subagent_id: u64Identifies the subagent (matches a prior RpcEvent::SubagentStart).
SubagentDone
A subagent has finished.
Fields
AgentEnd
The agent turn has completed. Carries final token-usage data.
Response
A response to a specific RpcCommand, correlated by id.
The body is flattened into the enclosing JSON object — its keys
appear at the top level alongside "type", "id", and "command".
Fields
id: StringEchoed from the originating RpcCommand’s id field.
Error
A protocol-level or runtime error.
id is None for errors not attributable to a specific command
(e.g. oversized frame, internal crash).
Fields
Ready
Emitted by the rpc child immediately after startup, before any commands are accepted.