#[non_exhaustive]pub enum ClientNotification {
CancelSessionNotification(Box<CancelSessionNotification>),
MessageMcpNotification(Box<MessageMcpNotification>),
ExtNotification(Box<ExtNotification>),
}unstable_protocol_v2 only.Expand description
All possible notifications that a client can send to an agent.
This enum is used internally for routing RPC notifications. You typically won’t need to use this directly.
Notifications do not expect a response.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
CancelSessionNotification(Box<CancelSessionNotification>)
Cancels ongoing operations for a session.
This is a notification sent by the client to cancel active work in a session.
Upon receiving this notification, the Agent SHOULD stop all language model requests and all tool call invocations as soon as possible.
After all ongoing operations have been successfully aborted and pending
updates have been sent, the Agent MUST send an idle state_update session
update with the cancelled stop reason if cancellation ended active
foreground work. No additional completion update is required if no
foreground work was active.
After cancellation completes, the Agent SHOULD ignore late answers rather than use them to resume the cancelled work.
Agents MUST catch errors caused by aborting cancelled work and report the
cancelled stop reason, not error.
The Agent MAY send content or tool call updates after receiving
session/cancel, but MUST send them before the idle state_update that
reports cancellation.
See protocol docs: Cancellation
MessageMcpNotification(Box<MessageMcpNotification>)
unstable_mcp_over_acp only.UNSTABLE
This capability is not part of the spec yet, and may be removed or changed at any point.
Sends an MCP-over-ACP notification.
ExtNotification(Box<ExtNotification>)
Handles extension notifications from the client.
Extension notifications provide a way to send one-way messages for custom functionality while maintaining protocol compatibility.
See protocol docs: Extensibility
Implementations§
Trait Implementations§
Source§impl Clone for ClientNotification
impl Clone for ClientNotification
Source§impl Debug for ClientNotification
impl Debug for ClientNotification
Source§impl<'de> Deserialize<'de> for ClientNotification
impl<'de> Deserialize<'de> for ClientNotification
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 JsonSchema for ClientNotification
Available on crate feature schemars only.
impl JsonSchema for ClientNotification
schemars only.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