session_updates
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AgentMessageChunk aclientp.schema.session_updates A chunk of the agent's response being streamed. |
||
| AgentPlanUpdate aclientp.schema.session_updates The agent's execution plan for complex tasks. |
||
| AgentThoughtChunk aclientp.schema.session_updates A chunk of the agent's internal reasoning being streamed. |
||
| AvailableCommandsUpdate aclientp.schema.session_updates Available commands are ready or have changed. |
||
| BaseChunk aclientp.schema.session_updates Base class for all session update chunks. |
||
| CompactionSummaryChunk aclientp.schema.session_updates A content block appended to a compaction's summary. |
||
| CompactionUpdate aclientp.schema.session_updates A context compaction upsert. |
||
| ConfigOptionUpdate aclientp.schema.session_updates A session configuration option value has changed. |
||
| Cost aclientp.schema.session_updates Cost information for a session. |
||
| CurrentModeUpdate aclientp.schema.session_updates The current mode of the session has changed. |
||
| CursorUpdate aclientp.schema.session_updates **UNSTABLE**: A session cursor was announced or its capabilities changed. |
||
| IdleStateUpdate aclientp.schema.session_updates **UNSTABLE**: The child is ready to process another prompt. |
||
| Notice aclientp.schema.session_updates Fire-and-forget information for the user. |
||
| PlanRemoved aclientp.schema.session_updates **UNSTABLE**: Remove an ID-addressed plan. |
||
| PlanUpdate aclientp.schema.session_updates **UNSTABLE**: Create or replace an ID-addressed plan. |
||
| PromptSuggestion aclientp.schema.session_updates **UNSTABLE**: A prompt the client can offer to the user. |
||
| PromptSuggestionsUpdate aclientp.schema.session_updates **UNSTABLE**: Suggested next prompts, replacing any previous suggestions. |
||
| RequiresActionStateUpdate aclientp.schema.session_updates **UNSTABLE**: Foreground work is blocked on user action. |
||
| RunningStateUpdate aclientp.schema.session_updates **UNSTABLE**: Foreground work is in progress. |
||
| SessionInfoUpdate aclientp.schema.session_updates Incremental update to session metadata. |
||
| SessionMessage aclientp.schema.session_updates **UNSTABLE**: A message exchanged between sessions (e.g. parent and subagent). |
||
| SessionMessageChunk aclientp.schema.session_updates **UNSTABLE**: A content block appended to a ``session_message``. |
||
| SubagentUpdate aclientp.schema.session_updates **UNSTABLE**: A subagent session started by the parent, or a change to it. |
||
| ToolCallProgress aclientp.schema.session_updates Update on the status or results of a tool call. |
||
| ToolCallStart aclientp.schema.session_updates Notification that a new tool call has been initiated. |
||
| UnknownStateUpdate aclientp.schema.session_updates **UNSTABLE**: The Agent cannot currently determine foreground activity. |
||
| Usage aclientp.schema.session_updates **UNSTABLE**: Token usage information for a prompt turn. |
||
| UsageUpdate aclientp.schema.session_updates Context window and cost update for a session. |
||
| UserMessageChunk aclientp.schema.session_updates A chunk of the user's message being streamed. |
🛈 DocStrings¶
Session update schema definitions.
CompactionId
module-attribute
¶
Agent-owned ID of a context compaction, unique within the session.
CompactionStatus
module-attribute
¶
Lifecycle state of a context compaction.
NoticeSeverity
module-attribute
¶
Severity hint for a session notice.
StateUpdate
module-attribute
¶
StateUpdate = Annotated[
Annotated[RunningStateUpdate, Tag("running")]
| Annotated[IdleStateUpdate, Tag("idle")]
| Annotated[RequiresActionStateUpdate, Tag("requires_action")]
| Annotated[UnknownStateUpdate, Tag("unknown")],
Discriminator(_state_discriminator),
]
UNSTABLE: State snapshot of a subagent session.
AgentMessageChunk
¶
AgentPlanUpdate
¶
Bases: AnnotatedObject
The agent's execution plan for complex tasks.
See protocol docs: Agent Plan.
Source code in src/aclientp/schema/session_updates.py
AgentThoughtChunk
¶
AvailableCommandsUpdate
¶
Bases: AnnotatedObject
Available commands are ready or have changed.
Source code in src/aclientp/schema/session_updates.py
available_commands
instance-attribute
¶
available_commands: Sequence[AvailableCommand]
Commands the agent can execute
session_update
class-attribute
instance-attribute
¶
session_update: Literal["available_commands_update"] = Field(
default="available_commands_update", init=False
)
Available commands are ready or have changed.
BaseChunk
¶
Bases: AnnotatedObject
Base class for all session update chunks.
Source code in src/aclientp/schema/session_updates.py
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 | |
message_id
class-attribute
instance-attribute
¶
UNSTABLE: A unique identifier for the message this chunk belongs to.
All chunks belonging to the same message share the same message_id.
A change in message_id indicates a new message has started.
Both clients and agents MUST use UUID format for message IDs.
audio
classmethod
¶
audio(
data: str | bytes,
mime_type: str,
*,
message_id: str | None = None,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a chunk containing audio content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
str | bytes
|
The audio data. |
required |
mime_type
|
str
|
The MIME type of the audio data. |
required |
message_id
|
str | None
|
Unique identifier for the message this chunk belongs to. |
None
|
audience
|
Audience | None
|
The audience for the audio chunk. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the audio chunk. |
None
|
priority
|
float | None
|
The priority of the audio chunk. |
None
|
Source code in src/aclientp/schema/session_updates.py
embedded_blob_resource
classmethod
¶
embedded_blob_resource(
data: bytes | str,
uri: str,
mime_type: str | None = None,
*,
message_id: str | None = None,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a chunk containing an embedded blob resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
bytes | str
|
The data to embed. |
required |
uri
|
str
|
The URI of the resource. |
required |
mime_type
|
str | None
|
The MIME type of the resource. |
None
|
message_id
|
str | None
|
Unique identifier for the message this chunk belongs to. |
None
|
audience
|
Audience | None
|
The audience to apply to the resource. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the resource. |
None
|
priority
|
float | None
|
The priority of the resource. |
None
|
Source code in src/aclientp/schema/session_updates.py
embedded_text_resource
classmethod
¶
embedded_text_resource(
text: str,
uri: str,
mime_type: str | None = None,
*,
message_id: str | None = None,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a chunk containing an embedded text resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to embed. |
required |
uri
|
str
|
The URI of the resource. |
required |
mime_type
|
str | None
|
The MIME type of the resource. |
None
|
message_id
|
str | None
|
Unique identifier for the message this chunk belongs to. |
None
|
audience
|
Audience | None
|
The audience to apply to the resource. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the resource. |
None
|
priority
|
float | None
|
The priority of the resource. |
None
|
Source code in src/aclientp/schema/session_updates.py
image
classmethod
¶
image(
data: str | bytes,
mime_type: str,
uri: str | None = None,
*,
message_id: str | None = None,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a chunk containing an embedded image resource.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
str | bytes
|
The image data. |
required |
mime_type
|
str
|
The MIME type of the image. |
required |
uri
|
str | None
|
The URI of the image. |
None
|
message_id
|
str | None
|
Unique identifier for the message this chunk belongs to. |
None
|
audience
|
Audience | None
|
The audience for the image. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the image. |
None
|
priority
|
float | None
|
The priority of the image. |
None
|
Source code in src/aclientp/schema/session_updates.py
resource
classmethod
¶
resource(
name: str,
uri: str,
description: str | None = None,
mime_type: str | None = None,
size: int | None = None,
title: str | None = None,
*,
message_id: str | None = None,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a chunk containing a resource content block.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the resource. |
required |
uri
|
str
|
The URI of the resource. |
required |
description
|
str | None
|
The description of the resource. |
None
|
mime_type
|
str | None
|
The MIME type of the resource. |
None
|
size
|
int | None
|
The size of the resource. |
None
|
title
|
str | None
|
The title of the resource. |
None
|
message_id
|
str | None
|
Unique identifier for the message this chunk belongs to. |
None
|
audience
|
Audience | None
|
The audience of the resource. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the resource. |
None
|
priority
|
float | None
|
The priority of the resource. |
None
|
Source code in src/aclientp/schema/session_updates.py
text
classmethod
¶
text(
text: str,
*,
message_id: str | None = None,
audience: Audience | None = None,
last_modified: datetime | str | None = None,
priority: float | None = None,
) -> Self
Create a chunk containing text.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text content. |
required |
message_id
|
str | None
|
Unique identifier for the message this chunk belongs to. |
None
|
audience
|
Audience | None
|
The audience for the text. |
None
|
last_modified
|
datetime | str | None
|
The last modified date of the text. |
None
|
priority
|
float | None
|
The priority of the text. |
None
|
Source code in src/aclientp/schema/session_updates.py
CompactionSummaryChunk
¶
Bases: AnnotatedObject
A content block appended to a compaction's summary.
A first-seen ID creates an in-progress compaction. Chunks append in receive order.
Source code in src/aclientp/schema/session_updates.py
compaction_id
instance-attribute
¶
compaction_id: CompactionId
ID of the compaction whose summary receives this content.
CompactionUpdate
¶
Bases: AnnotatedObject
A context compaction upsert.
The first notification fixes the compaction's timeline position.
Later updates with the same ID patch that entity in place.
Only sent if the client advertised session.compaction.
Source code in src/aclientp/schema/session_updates.py
compaction_id
instance-attribute
¶
compaction_id: CompactionId
The Agent-owned ID of this compaction.
error
class-attribute
instance-attribute
¶
Human-readable error details for the compaction.
summary
class-attribute
instance-attribute
¶
Complete replacement user-displayable summary content for the compaction.
ConfigOptionUpdate
¶
Bases: AnnotatedObject
A session configuration option value has changed.
The full set of configuration options and their current values is sent on every change. Clients should replace their cached list entirely.
See protocol docs: Session Config Options <https://agentclientprotocol.com/protocol/session-config-options>_
Source code in src/aclientp/schema/session_updates.py
config_options
instance-attribute
¶
config_options: Sequence[SessionConfigOption]
The full set of configuration options and their current values.
Cost
¶
Bases: AnnotatedObject
Cost information for a session.
Source code in src/aclientp/schema/session_updates.py
CurrentModeUpdate
¶
Bases: AnnotatedObject
The current mode of the session has changed.
See protocol docs: Session Modes
Source code in src/aclientp/schema/session_updates.py
CursorUpdate
¶
Bases: AnnotatedObject
UNSTABLE: A session cursor was announced or its capabilities changed.
Upserts by cursor_id. The first update for a cursor MUST include anchor,
which is fixed afterwards; later updates change only capabilities.
Only sent if the client advertised session.cursors.
Source code in src/aclientp/schema/session_updates.py
anchor
class-attribute
instance-attribute
¶
anchor: CursorAnchor | None = None
Where the cursor is. Required on the first update for a cursor.
capabilities
class-attribute
instance-attribute
¶
capabilities: CursorCapabilities | None = None
The methods that currently accept this cursor; a new cursor starts with none.
IdleStateUpdate
¶
Bases: AnnotatedObject
UNSTABLE: The child is ready to process another prompt.
Source code in src/aclientp/schema/session_updates.py
error
class-attribute
instance-attribute
¶
error: Error | None = None
For stop_reason: "error": the failure, as a JSON-RPC error object.
stop_reason
class-attribute
instance-attribute
¶
stop_reason: (
Literal["end_turn", "max_tokens", "max_turn_requests", "refusal", "cancelled", "error"]
| str
| None
) = None
Why foreground work stopped. Omitted when there is no stop reason.
Notice
¶
Bases: AnnotatedObject
Fire-and-forget information for the user.
Only sent if the client advertised session.notices.
Source code in src/aclientp/schema/session_updates.py
description
class-attribute
instance-attribute
¶
Optional plain-text detail or guidance.
PlanRemoved
¶
Bases: AnnotatedObject
UNSTABLE: Remove an ID-addressed plan.
Source code in src/aclientp/schema/session_updates.py
PlanUpdate
¶
Bases: AnnotatedObject
UNSTABLE: Create or replace an ID-addressed plan.
Only sent if the client advertised the plan capability.
Source code in src/aclientp/schema/session_updates.py
PromptSuggestion
¶
Bases: AnnotatedObject
UNSTABLE: A prompt the client can offer to the user.
Source code in src/aclientp/schema/session_updates.py
PromptSuggestionsUpdate
¶
Bases: AnnotatedObject
UNSTABLE: Suggested next prompts, replacing any previous suggestions.
Only sent if the client advertised session.prompt_suggestions.
Source code in src/aclientp/schema/session_updates.py
suggestions
instance-attribute
¶
suggestions: Sequence[PromptSuggestion]
The suggestions the Client can offer, ordered most likely first.
RequiresActionStateUpdate
¶
Bases: AnnotatedObject
UNSTABLE: Foreground work is blocked on user action.
Source code in src/aclientp/schema/session_updates.py
RunningStateUpdate
¶
Bases: AnnotatedObject
UNSTABLE: Foreground work is in progress.
Source code in src/aclientp/schema/session_updates.py
SessionInfoUpdate
¶
Bases: AnnotatedObject
Incremental update to session metadata.
Used to notify clients of changes to session info (title, timestamps) without requiring a full session list refresh.
Fields that are None are not changed. To update a field, set it to a value.
Source code in src/aclientp/schema/session_updates.py
SessionMessage
¶
Bases: AnnotatedObject
UNSTABLE: A message exchanged between sessions (e.g. parent and subagent).
Upserts by message_id: omitted fields are left unchanged, None clears them.
Source code in src/aclientp/schema/session_updates.py
content
class-attribute
instance-attribute
¶
Replaces all content when non-empty. None or [] clears it.
message_id
instance-attribute
¶
Identifier of this message within the enclosing session's transcript.
recipient_message_id
class-attribute
instance-attribute
¶
On an outgoing view, the message_id of the incoming view in the recipient.
recipient_session_id
class-attribute
instance-attribute
¶
The receiving session.
sender_message_id
class-attribute
instance-attribute
¶
On an incoming view, the message_id of the outgoing view in the sender's transcript.
sender_session_id
class-attribute
instance-attribute
¶
The sending session.
SessionMessageChunk
¶
Bases: AnnotatedObject
UNSTABLE: A content block appended to a session_message.
Source code in src/aclientp/schema/session_updates.py
SubagentUpdate
¶
Bases: AnnotatedObject
UNSTABLE: A subagent session started by the parent, or a change to it.
Only sent if the client advertised the subagents capability.
Source code in src/aclientp/schema/session_updates.py
additional_directories
class-attribute
instance-attribute
¶
Additional workspace roots for the child. Each path must be absolute.
capabilities
class-attribute
instance-attribute
¶
capabilities: SubagentSessionCapabilities | None = None
Client-initiated session mutations permitted for this subagent session.
cwd
class-attribute
instance-attribute
¶
The child's working directory. Must be an absolute path.
description
class-attribute
instance-attribute
¶
The parent's description of the child's role or purpose.
session_id
instance-attribute
¶
The opaque session ID identifying the child in all ACP messages.
state
class-attribute
instance-attribute
¶
state: StateUpdate | None = None
Current state snapshot for the child session.
title
class-attribute
instance-attribute
¶
The parent's human-readable display title for this child.
ToolCallProgress
¶
Bases: AnnotatedObject
Update on the status or results of a tool call.
Source code in src/aclientp/schema/session_updates.py
content
class-attribute
instance-attribute
¶
Replace the content collection.
locations
class-attribute
instance-attribute
¶
locations: Sequence[ToolCallLocation] | None = None
Replace the locations collection.
name
class-attribute
instance-attribute
¶
Update the programmatic name of the tool being invoked.
raw_output
class-attribute
instance-attribute
¶
Update the raw output.
session_update
class-attribute
instance-attribute
¶
Tool call update.
status
class-attribute
instance-attribute
¶
Update the execution status.
title
class-attribute
instance-attribute
¶
Update the human-readable title.
ToolCallStart
¶
Bases: AnnotatedObject
Notification that a new tool call has been initiated.
Source code in src/aclientp/schema/session_updates.py
content
class-attribute
instance-attribute
¶
Content produced by the tool call.
kind
class-attribute
instance-attribute
¶
The category of tool being invoked.
Helps clients choose appropriate icons and UI treatment.
locations
class-attribute
instance-attribute
¶
locations: Sequence[ToolCallLocation] | None = None
File locations affected by this tool call.
Enables "follow-along" features in clients.
name
class-attribute
instance-attribute
¶
Programmatic name of the tool being invoked.
raw_input
class-attribute
instance-attribute
¶
Raw input parameters sent to the tool.
raw_output
class-attribute
instance-attribute
¶
Raw output returned by the tool.
session_update
class-attribute
instance-attribute
¶
Notification that a new tool call has been initiated.
status
class-attribute
instance-attribute
¶
Current execution status of the tool call.
tool_call_id
instance-attribute
¶
Unique identifier for this tool call within the session.
UnknownStateUpdate
¶
Bases: AnnotatedObject
UNSTABLE: The Agent cannot currently determine foreground activity.
Also used for custom or future states, whose raw value is kept in state.
Source code in src/aclientp/schema/session_updates.py
Usage
¶
Bases: AnnotatedObject
UNSTABLE: Token usage information for a prompt turn.
Source code in src/aclientp/schema/session_updates.py
cached_read_tokens
class-attribute
instance-attribute
¶
Total cache read tokens.
cached_write_tokens
class-attribute
instance-attribute
¶
Total cache write tokens.
input_tokens
class-attribute
instance-attribute
¶
Total input tokens across all turns.
output_tokens
class-attribute
instance-attribute
¶
Total output tokens across all turns.
thought_tokens
class-attribute
instance-attribute
¶
Total thought/reasoning tokens.
total_tokens
class-attribute
instance-attribute
¶
Sum of all token types across session.
UsageUpdate
¶
Bases: AnnotatedObject
Context window and cost update for a session.