pub struct SessionContextInfo {
pub buffer_tokens: i64,
pub compaction_threshold: i64,
pub conversation_tokens: i64,
pub limit: i64,
pub mcp_tools_tokens: i64,
pub model_name: String,
pub prompt_token_limit: i64,
pub system_tokens: i64,
pub tool_definitions_tokens: i64,
pub total_tokens: i64,
}Expand description
Token breakdown for the current context window, or null if the session has not yet been initialized (no system prompt or tool metadata cached).
Experimental. This type is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases.
Fields§
§buffer_tokens: i64Output reserve plus tokens after the buffer-exhaustion blocking threshold (default 95%)
compaction_threshold: i64Token count at which background compaction starts (configurable percentage of promptTokenLimit)
conversation_tokens: i64Tokens consumed by user/assistant/tool messages
limit: i64Prompt token limit plus the model’s full output token limit.
mcp_tools_tokens: i64Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools)
model_name: StringThe model used for token counting
prompt_token_limit: i64Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified)
system_tokens: i64Tokens consumed by the system prompt
tool_definitions_tokens: i64Tokens consumed by tool definitions sent to the model (excludes deferred tools)
total_tokens: i64Sum of system, conversation and tool-definition tokens
Trait Implementations§
Source§impl Clone for SessionContextInfo
impl Clone for SessionContextInfo
Source§fn clone(&self) -> SessionContextInfo
fn clone(&self) -> SessionContextInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more