session_updates
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| AvailableCommandsUpdate aclientp.schema.v2.session_updates The available commands are ready or have changed. |
||
| CompactionSummaryChunk aclientp.schema.v2.session_updates A content block appended to a compaction's summary. |
||
| CompactionUpdate aclientp.schema.v2.session_updates A context compaction upsert, keyed by ``compaction_id``. |
||
| ConfigOptionUpdate aclientp.schema.v2.session_updates The session's config options have changed. |
||
| IdleStateSessionUpdate aclientp.schema.v2.session_updates ``state_update``: no foreground work is active. |
||
| Notice aclientp.schema.v2.session_updates Fire-and-forget information for the user, not part of session history. |
||
| OtherStateSessionUpdate aclientp.schema.v2.session_updates ``state_update`` with a custom or future state. |
||
| PromptSuggestion aclientp.schema.v2.session_updates **UNSTABLE**: A prompt the agent predicts the user will send next. |
||
| PromptSuggestionsUpdate aclientp.schema.v2.session_updates **UNSTABLE**: Replaces the session's prompt suggestions. |
||
| ReplayComplete aclientp.schema.v2.session_updates The history replay requested by ``session/resume`` is complete. |
||
| RequiresActionStateSessionUpdate aclientp.schema.v2.session_updates ``state_update``: foreground work is blocked on user action. |
||
| RunningStateSessionUpdate aclientp.schema.v2.session_updates ``state_update``: foreground work is in progress. |
||
| SessionInfoUpdate aclientp.schema.v2.session_updates Partial update of session metadata; ``None`` clears a field. |
||
| ToolCallSessionUpdate aclientp.schema.v2.session_updates ``tool_call_update``: a tool call was created or updated. |
||
| UnknownSessionUpdate aclientp.schema.v2.session_updates A custom or future session update; values starting with ``_`` are extensions. |
||
| UnknownStateSessionUpdate aclientp.schema.v2.session_updates ``state_update``: the agent cannot currently determine foreground activity. |
||
| UpdateSessionNotification aclientp.schema.v2.session_updates Parameters of ``session/update``: one update of a session. |
||
| UsageUpdate aclientp.schema.v2.session_updates Context window and cost of the session. |
🛈 DocStrings¶
v2 session/update: the :data:SessionUpdate union and the smaller updates.
CompactionStatus
module-attribute
¶
Lifecycle state of a context compaction. Values starting with _ are extensions.
NoticeSeverity
module-attribute
¶
Severity hint of a notice. Values starting with _ are extensions.
SessionUpdate
module-attribute
¶
SessionUpdate = Annotated[
Annotated[UserMessageChunk, Tag("user_message_chunk")]
| Annotated[UserMessage, Tag("user_message")]
| Annotated[AgentMessageChunk, Tag("agent_message_chunk")]
| Annotated[AgentMessage, Tag("agent_message")]
| Annotated[AgentThoughtChunk, Tag("agent_thought_chunk")]
| Annotated[AgentThought, Tag("agent_thought")]
| Annotated[StateSessionUpdate, Tag("state_update")]
| Annotated[ToolCallContentChunk, Tag("tool_call_content_chunk")]
| Annotated[ToolCallSessionUpdate, Tag("tool_call_update")]
| Annotated[TerminalUpdate, Tag("terminal_update")]
| Annotated[TerminalOutputChunk, Tag("terminal_output_chunk")]
| Annotated[PlanUpdate, Tag("plan_update")]
| Annotated[PlanRemoved, Tag("plan_removed")]
| Annotated[AvailableCommandsUpdate, Tag("available_commands_update")]
| Annotated[ConfigOptionUpdate, Tag("config_option_update")]
| Annotated[SessionInfoUpdate, Tag("session_info_update")]
| Annotated[UsageUpdate, Tag("usage_update")]
| Annotated[Notice, Tag("notice")]
| Annotated[CompactionUpdate, Tag("compaction_update")]
| Annotated[CompactionSummaryChunk, Tag("compaction_summary_chunk")]
| Annotated[ReplayComplete, Tag("replay_complete")]
| Annotated[PromptSuggestionsUpdate, Tag("prompt_suggestions_update")]
| Annotated[CursorUpdate, Tag("cursor_update")]
| Annotated[SubagentUpdate, Tag("subagent_update")]
| Annotated[SessionMessage, Tag("session_message")]
| Annotated[SessionMessageChunk, Tag("session_message_chunk")]
| Annotated[UnknownSessionUpdate, Tag(OTHER_TAG)],
Discriminator(open_discriminator("sessionUpdate", _SESSION_UPDATES)),
]
An update sent while a session exists: messages, progress and other activity.
StateSessionUpdate
module-attribute
¶
StateSessionUpdate = Annotated[
Annotated[RunningStateSessionUpdate, Tag("running")]
| Annotated[IdleStateSessionUpdate, Tag("idle")]
| Annotated[RequiresActionStateSessionUpdate, Tag("requires_action")]
| Annotated[UnknownStateSessionUpdate, Tag("unknown")]
| Annotated[OtherStateSessionUpdate, Tag(OTHER_TAG)],
Discriminator(
open_discriminator("state", frozenset({"running", "idle", "requires_action", "unknown"}))
),
]
A state_update session update: a snapshot of the session's foreground activity.
AvailableCommandsUpdate
¶
Bases: AnnotatedObject
The available commands are ready or have changed.
Source code in src/aclientp/schema/v2/session_updates.py
available_commands
instance-attribute
¶
available_commands: Sequence[AvailableCommand]
All commands the agent can execute.
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/v2/session_updates.py
compaction_id
instance-attribute
¶
compaction_id: CompactionId
The compaction whose summary receives the content.
CompactionUpdate
¶
Bases: AnnotatedObject
A context compaction upsert, keyed by compaction_id.
The first update fixes the compaction's position in the timeline; summary and
error are patches.
Source code in src/aclientp/schema/v2/session_updates.py
compaction_id
instance-attribute
¶
compaction_id: CompactionId
The agent-owned ID of the compaction, unique within the session.
error
class-attribute
instance-attribute
¶
Human-readable error details.
status
class-attribute
instance-attribute
¶
status: CompactionStatus | MISSING | None = MISSING
Current lifecycle status; omitted leaves it unchanged, None resets it to
in_progress. A new compaction starts as in_progress.
summary
class-attribute
instance-attribute
¶
summary: Sequence[ContentBlock] | MISSING | None = MISSING
Complete replacement summary content to show the user.
ConfigOptionUpdate
¶
Bases: AnnotatedObject
The session's config options have changed.
Source code in src/aclientp/schema/v2/session_updates.py
config_options
instance-attribute
¶
config_options: Sequence[SessionConfigOption]
All config options and their current values.
IdleStateSessionUpdate
¶
Bases: IdleStateUpdate
state_update: no foreground work is active.
Source code in src/aclientp/schema/v2/session_updates.py
Notice
¶
Bases: AnnotatedObject
Fire-and-forget information for the user, not part of session history.
Agents must not rely on a notice being received or shown.
Source code in src/aclientp/schema/v2/session_updates.py
OtherStateSessionUpdate
¶
Bases: OtherStateUpdate
state_update with a custom or future state.
Source code in src/aclientp/schema/v2/session_updates.py
PromptSuggestion
¶
Bases: AnnotatedObject
UNSTABLE: A prompt the agent predicts the user will send next.
Source code in src/aclientp/schema/v2/session_updates.py
prompt
class-attribute
instance-attribute
¶
prompt: Sequence[ContentBlock] = Field(min_length=1)
The content of the suggested prompt.
PromptSuggestionsUpdate
¶
Bases: AnnotatedObject
UNSTABLE: Replaces the session's prompt suggestions.
Source code in src/aclientp/schema/v2/session_updates.py
suggestions
instance-attribute
¶
suggestions: Sequence[PromptSuggestion]
Suggestions, most likely first; an empty list withdraws all.
ReplayComplete
¶
Bases: AnnotatedObject
The history replay requested by session/resume is complete.
Sent once per session/resume with replayFrom; a resume that ends without it
delivered a truncated replay.
Source code in src/aclientp/schema/v2/session_updates.py
RequiresActionStateSessionUpdate
¶
Bases: RequiresActionStateUpdate
state_update: foreground work is blocked on user action.
Source code in src/aclientp/schema/v2/session_updates.py
RunningStateSessionUpdate
¶
Bases: RunningStateUpdate
state_update: foreground work is in progress.
Source code in src/aclientp/schema/v2/session_updates.py
SessionInfoUpdate
¶
Bases: AnnotatedObject
Partial update of session metadata; None clears a field.
Source code in src/aclientp/schema/v2/session_updates.py
ToolCallSessionUpdate
¶
Bases: ToolCallUpdate
tool_call_update: a tool call was created or updated.
Source code in src/aclientp/schema/v2/session_updates.py
UnknownSessionUpdate
¶
Bases: Unknown
A custom or future session update; values starting with _ are extensions.
Source code in src/aclientp/schema/v2/session_updates.py
UnknownStateSessionUpdate
¶
Bases: UnknownStateUpdate
state_update: the agent cannot currently determine foreground activity.
Source code in src/aclientp/schema/v2/session_updates.py
UpdateSessionNotification
¶
Bases: AnnotatedObject
Parameters of session/update: one update of a session.
Source code in src/aclientp/schema/v2/session_updates.py
UsageUpdate
¶
Bases: AnnotatedObject
Context window and cost of the session.