#[non_exhaustive]pub enum SessionUpdate {
Show 21 variants
UserMessageChunk(ContentChunk),
AgentMessageChunk(ContentChunk),
AgentThoughtChunk(ContentChunk),
ToolCall(ToolCall),
ToolCallUpdate(ToolCallUpdate),
Plan(Plan),
PlanUpdate(PlanUpdate),
PlanRemoved(PlanRemoved),
AvailableCommandsUpdate(AvailableCommandsUpdate),
CurrentModeUpdate(CurrentModeUpdate),
ConfigOptionUpdate(ConfigOptionUpdate),
SessionInfoUpdate(SessionInfoUpdate),
UsageUpdate(UsageUpdate),
Notice(Notice),
CompactionUpdate(CompactionUpdate),
CompactionSummaryChunk(CompactionSummaryChunk),
PromptSuggestionsUpdate(PromptSuggestionsUpdate),
CursorUpdate(CursorUpdate),
SubagentUpdate(SubagentUpdate),
SessionMessage(SessionMessage),
SessionMessageChunk(SessionMessageChunk),
}Expand description
Different types of updates that can be sent during session processing.
These updates provide real-time feedback about the agent’s progress.
See protocol docs: Agent Reports Output
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
UserMessageChunk(ContentChunk)
A chunk of the user’s message being streamed.
AgentMessageChunk(ContentChunk)
A chunk of the agent’s response being streamed.
AgentThoughtChunk(ContentChunk)
A chunk of the agent’s internal reasoning being streamed.
ToolCall(ToolCall)
Notification that a new tool call has been initiated.
ToolCallUpdate(ToolCallUpdate)
Update on the status or results of a tool call.
Plan(Plan)
The agent’s execution plan for complex tasks. See protocol docs: Agent Plan
PlanUpdate(PlanUpdate)
Replaces the plan with this ID. Agents MUST NOT send this update unless
the Client advertised plan.
PlanRemoved(PlanRemoved)
Removes the plan with this ID. Agents MUST NOT send this update unless
the Client advertised plan.
AvailableCommandsUpdate(AvailableCommandsUpdate)
Available commands are ready or have changed
CurrentModeUpdate(CurrentModeUpdate)
The current mode of the session has changed
See protocol docs: Session Modes
ConfigOptionUpdate(ConfigOptionUpdate)
Session configuration options have been updated.
SessionInfoUpdate(SessionInfoUpdate)
Session metadata has been updated (title, timestamps, custom metadata)
UsageUpdate(UsageUpdate)
Context window and cost update for the session.
Notice(Notice)
Information for the user that is not part of session history.
Agents MUST only send this update when the Client advertised
the session.notices Client capability.
CompactionUpdate(CompactionUpdate)
A context compaction has been created or updated.
Agents MUST only send this update when the Client advertised
the session.compaction Client capability.
CompactionSummaryChunk(CompactionSummaryChunk)
A content block appended to a context compaction’s retained summary.
Agents MUST only send this update when the Client advertised
the session.compaction Client capability.
PromptSuggestionsUpdate(PromptSuggestionsUpdate)
unstable_prompt_suggestions only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Replaces the session’s current list of prompt suggestions.
Agents MUST only send this update when the Client advertised
the session.promptSuggestions Client capability.
CursorUpdate(CursorUpdate)
unstable_session_cursors only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
A session cursor has been announced or its capabilities have changed.
Agents MUST only send this update when the Client advertised
the session.cursors Client capability.
SubagentUpdate(SubagentUpdate)
Announces a child session created and owned by this session, or updates that ownership association’s metadata.
Agents MUST only send this update when the Client advertised
the subagents Client capability.
See protocol docs: Subagents
SessionMessage(SessionMessage)
A message upsert observed in this session’s transcript, sent to or received from another session.
Agents MUST only send this update when the Client advertised
the subagents Client capability.
See protocol docs: Session-directed messages
SessionMessageChunk(SessionMessageChunk)
One content block appended to a sent or received session message.
Agents MUST only send this update when the Client advertised
the subagents Client capability.
See protocol docs: Session-directed messages
Trait Implementations§
Source§impl Clone for SessionUpdate
impl Clone for SessionUpdate
Source§fn clone(&self) -> SessionUpdate
fn clone(&self) -> SessionUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SessionUpdate
impl Debug for SessionUpdate
Source§impl<'de> Deserialize<'de> for SessionUpdate
impl<'de> Deserialize<'de> for SessionUpdate
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SessionUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SessionUpdate, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SessionUpdate
impl JsonSchema for SessionUpdate
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more