pub struct AgentSession {Show 14 fields
pub id: AgentSessionId,
pub name: Option<String>,
pub cursor: TraversalCursor,
pub capabilities: AgentCapabilities,
pub limits: SessionLimits,
pub budget: BudgetTracker,
pub metrics: SessionMetrics,
pub state: SessionState,
pub created_at: DateTime<Utc>,
pub last_active: DateTime<Utc>,
pub last_results: Vec<BlockId>,
pub context_blocks: HashSet<BlockId>,
pub focus_block: Option<BlockId>,
pub codegraph_context: Option<CodeGraphContextSession>,
}Expand description
Agent session state - tracks individual agent’s position and history.
Fields§
§id: AgentSessionIdUnique session identifier.
name: Option<String>Human-readable session name.
cursor: TraversalCursorCurrent cursor position in the graph.
capabilities: AgentCapabilitiesAgent capabilities.
limits: SessionLimitsSafety limits for this session.
budget: BudgetTrackerBudget tracker.
metrics: SessionMetricsMetrics and telemetry.
state: SessionStateSession state.
created_at: DateTime<Utc>Creation timestamp.
last_active: DateTime<Utc>Last activity timestamp.
last_results: Vec<BlockId>Last search/find results for CTX ADD RESULTS.
context_blocks: HashSet<BlockId>Generic selected blocks in the context window.
focus_block: Option<BlockId>Focus block for context (protected from pruning).
codegraph_context: Option<CodeGraphContextSession>Codegraph-specific working set state when the active document is a codegraph.
Implementations§
Source§impl AgentSession
impl AgentSession
pub fn new(start_block: BlockId, config: SessionConfig) -> Self
Sourcepub fn is_timed_out(&self) -> bool
pub fn is_timed_out(&self) -> bool
Check if session has timed out.
Sourcepub fn check_active(&self) -> Result<()>
pub fn check_active(&self) -> Result<()>
Check if session can perform an operation.
Sourcepub fn check_can_traverse(&self) -> Result<()>
pub fn check_can_traverse(&self) -> Result<()>
Check if session can traverse.
Sourcepub fn check_can_search(&self) -> Result<()>
pub fn check_can_search(&self) -> Result<()>
Check if session can search.
Sourcepub fn check_can_modify_context(&self) -> Result<()>
pub fn check_can_modify_context(&self) -> Result<()>
Check if session can modify context.
Sourcepub fn store_results(&mut self, results: Vec<BlockId>)
pub fn store_results(&mut self, results: Vec<BlockId>)
Store last search/find results.
Sourcepub fn get_last_results(&self) -> Result<&[BlockId]>
pub fn get_last_results(&self) -> Result<&[BlockId]>
Get last results (for CTX ADD RESULTS).
pub fn ensure_codegraph_context(&mut self) -> &mut CodeGraphContextSession
Sourcepub fn info(&self) -> SessionInfo
pub fn info(&self) -> SessionInfo
Get session info as serializable struct.