#[non_exhaustive]pub enum SessionUpdate {
Show 16 variants
UserMessageChunk(ContentChunk),
UserMessage(UserMessage),
AgentMessageChunk(ContentChunk),
AgentMessage(AgentMessage),
AgentThoughtChunk(ContentChunk),
AgentThought(AgentThought),
StateUpdate(StateUpdate),
ToolCallContentChunk(ToolCallContentChunk),
ToolCallUpdate(ToolCallUpdate),
PlanUpdate(PlanUpdate),
PlanRemoved(PlanRemoved),
AvailableCommandsUpdate(AvailableCommandsUpdate),
ConfigOptionUpdate(ConfigOptionUpdate),
SessionInfoUpdate(SessionInfoUpdate),
UsageUpdate(UsageUpdate),
Other(OtherSessionUpdate),
}unstable_protocol_v2 only.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.
UserMessage(UserMessage)
A user message has been created or updated.
Agents can send this when they accept or replay a user message. When a
client receives another user_message update with the same messageId,
fields in the new update patch the previous fields for that message.
AgentMessageChunk(ContentChunk)
A chunk of the agent’s response being streamed.
AgentMessage(AgentMessage)
An agent message has been created or updated.
Agents can send this in addition to streamed chunks. When a client
receives another agent_message update with the same messageId,
fields in the new update patch the previous fields for that message.
AgentThoughtChunk(ContentChunk)
A chunk of the agent’s internal reasoning being streamed.
AgentThought(AgentThought)
An agent thought or reasoning message has been created or updated.
Agents can send this in addition to streamed chunks. When a client
receives another agent_thought update with the same messageId,
fields in the new update patch the previous fields for that message.
StateUpdate(StateUpdate)
The agent’s session state has changed.
Agents send this to report when work starts, completes, or pauses while
waiting for user action. Completion of active work is reported here instead
of in the session/prompt response.
ToolCallContentChunk(ToolCallContentChunk)
A chunk of tool-call content being streamed.
ToolCallUpdate(ToolCallUpdate)
A tool call has been created or updated.
PlanUpdate(PlanUpdate)
A content update for a plan identified by ID. See protocol docs: Agent Plan
PlanRemoved(PlanRemoved)
unstable_plan_operations only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Removal notice for a plan identified by ID.
AvailableCommandsUpdate(AvailableCommandsUpdate)
Available commands are ready or have changed
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.
Other(OtherSessionUpdate)
Custom or future session update.
Values beginning with _ are reserved for implementation-specific
extensions. Unknown values that do not begin with _ are reserved for
future ACP variants.
Receivers that do not understand this update type should preserve the raw payload when storing, replaying, proxying, or forwarding session history, and otherwise ignore it or display it generically.
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl IntoV1Many for SessionUpdate
impl IntoV1Many for SessionUpdate
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 moreSource§impl PartialEq for SessionUpdate
impl PartialEq for SessionUpdate
Source§fn eq(&self, other: &SessionUpdate) -> bool
fn eq(&self, other: &SessionUpdate) -> bool
self and other values to be equal, and is used by ==.