pub struct SessionState {Show 14 fields
pub summary: SessionSummary,
pub lifecycle: SessionLifecycle,
pub creation_error: Option<ErrorInfo>,
pub server_tools: Option<Vec<ToolDefinition>>,
pub active_client: Option<SessionActiveClient>,
pub turns: Vec<Turn>,
pub active_turn: Option<ActiveTurn>,
pub steering_message: Option<PendingMessage>,
pub queued_messages: Option<Vec<PendingMessage>>,
pub input_requests: Option<Vec<SessionInputRequest>>,
pub config: Option<SessionConfigState>,
pub customizations: Option<Vec<Customization>>,
pub changesets: Option<Vec<Changeset>>,
pub meta: Option<JsonObject>,
}Expand description
Full state for a single session, loaded when a client subscribes to the session’s URI.
Fields§
§summary: SessionSummaryLightweight session metadata
lifecycle: SessionLifecycleSession initialization state
creation_error: Option<ErrorInfo>Error details if creation failed
server_tools: Option<Vec<ToolDefinition>>Tools provided by the server (agent host) for this session
active_client: Option<SessionActiveClient>The client currently providing tools and interactive capabilities to this session
turns: Vec<Turn>Completed turns
active_turn: Option<ActiveTurn>Currently in-progress turn
steering_message: Option<PendingMessage>Message to inject into the current turn at a convenient point
queued_messages: Option<Vec<PendingMessage>>Messages to send automatically as new turns after the current turn finishes
input_requests: Option<Vec<SessionInputRequest>>Requests for user input that are currently blocking or informing session progress
config: Option<SessionConfigState>Session configuration schema and current values
customizations: Option<Vec<Customization>>Top-level customizations active in this session.
Always one of the {@link Customization} variants:
- Container customizations ({@link PluginCustomization},
{@link DirectoryCustomization}) whose children — agents, skills,
prompts, rules, hooks, MCP servers — live in each container’s
{@link ContainerCustomizationBase.children |
children} array. - Top-level {@link McpServerCustomization} entries the host surfaces directly (for example a globally-configured MCP server that isn’t bundled in a plugin or directory). MCP servers may also appear as children of a container.
Client-published plugins arrive via
{@link SessionActiveClient.customizations | activeClient.customizations}
and the host propagates them into this list (typically with the
container’s clientId set and children populated). Clients
publish in container shape only; bare MCP servers at the top level
are server-originated.
changesets: Option<Vec<Changeset>>Catalogue of changesets the server can produce for this session. Each entry advertises a subscribable view of file changes (uncommitted, session-wide, per-turn, etc.) and the URI template the client expands before subscribing. See {@link Changeset} for the full shape and {@link /guide/changesets | Changesets} for an overview of the model.
meta: Option<JsonObject>Additional provider-specific metadata for this session.
Clients MAY look for well-known keys here to provide enhanced UI.
For example, a git key may provide extra git metadata about the session’s
workingDirectory.
Trait Implementations§
Source§impl Clone for SessionState
impl Clone for SessionState
Source§fn clone(&self) -> SessionState
fn clone(&self) -> SessionState
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 SessionState
impl Debug for SessionState
Source§impl<'de> Deserialize<'de> for SessionState
impl<'de> Deserialize<'de> for SessionState
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 PartialEq for SessionState
impl PartialEq for SessionState
Source§fn eq(&self, other: &SessionState) -> bool
fn eq(&self, other: &SessionState) -> bool
self and other values to be equal, and is used by ==.