pub enum WsMessage {
Show 26 variants
Snapshot {
data: Value,
},
Text {
text: String,
},
TextDelta {
delta: String,
},
ToolExecuting {
name: String,
arguments: String,
},
ToolResult {
name: String,
result: String,
is_error: bool,
},
Reasoning {
text: String,
},
ReasoningDelta {
delta: String,
},
Round {
round: u32,
max_rounds: u32,
context_pct: f64,
},
Phase {
phase: String,
},
Question {
question: UserQuestion,
},
QuestionDismissed,
Finished,
Log {
line: LogLine,
},
Extension {
data: Value,
},
UserMessage {
message: String,
},
TokenUsage {
prompt_tokens: u32,
completion_tokens: u32,
},
ToolCallsReceived {
round: u32,
count: usize,
},
ToolCacheHit {
name: String,
arguments: String,
},
Eviction {
freed_chars: usize,
evicted_count: usize,
},
Compaction {
compaction_number: usize,
},
ModelRouted {
model: String,
round: u32,
},
CheckpointSaved {
round: u32,
path: String,
},
CheckpointResumed {
round: u32,
},
EmptyResponse {
round: u32,
attempt: u32,
max_retries: u32,
},
ApprovalRequired {
name: String,
arguments: String,
},
TodoUpdate {
content: String,
},
}Expand description
A message sent from the server to WebSocket clients.
Discriminated on the type field when serialized to JSON.
Variants§
Snapshot
Full state snapshot (sent on initial connect and after reconnect).
Text
Complete LLM text block.
TextDelta
Streaming token delta.
ToolExecuting
A tool is about to execute.
ToolResult
A tool finished executing.
Reasoning
LLM reasoning / extended thinking content.
ReasoningDelta
Streaming reasoning delta.
Round
Round progress update.
Phase
Phase change.
Question
A question has been presented to the user.
Fields
question: UserQuestionQuestionDismissed
The active question has been resolved.
Finished
The agent finished (no more tool calls).
Log
A log line captured from tracing.
Extension
Domain-specific extension state update.
UserMessage
A user message sent from the chat UI.
TokenUsage
Token usage for the current round.
ToolCallsReceived
The agent received tool calls this round.
ToolCacheHit
A tool result was served from cache.
Eviction
Context eviction freed memory.
Compaction
Context compaction completed.
ModelRouted
Model routing selected a different model.
CheckpointSaved
Checkpoint saved after a round.
CheckpointResumed
Resumed from a checkpoint.
EmptyResponse
The API returned an empty response and is retrying.
ApprovalRequired
A tool execution requires human approval.
TodoUpdate
Consolidated todo list update (replaces previous state in the client).