pub trait SessionServiceControlExt: SessionService {
// Required method
fn append_system_context<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
req: AppendSystemContextRequest,
) -> Pin<Box<dyn Future<Output = Result<AppendSystemContextResult, SessionControlError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn stage_tool_results<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
req: StageToolResultsRequest,
) -> Pin<Box<dyn Future<Output = Result<StageToolResultsResult, SessionError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}Expand description
Optional control-plane extension for SessionService.
Keeps the base lifecycle contract minimal while exposing first-class session mutation operations shared across external surfaces.
Required Methods§
Sourcefn append_system_context<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
req: AppendSystemContextRequest,
) -> Pin<Box<dyn Future<Output = Result<AppendSystemContextResult, SessionControlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_system_context<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
req: AppendSystemContextRequest,
) -> Pin<Box<dyn Future<Output = Result<AppendSystemContextResult, SessionControlError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Append runtime system context to a session.
The request is idempotent per (session_id, idempotency_key). When a
turn is active, implementations may stage the append for application at
the next LLM boundary rather than mutating in-flight request state.
Provided Methods§
Sourcefn stage_tool_results<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
req: StageToolResultsRequest,
) -> Pin<Box<dyn Future<Output = Result<StageToolResultsResult, SessionError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn stage_tool_results<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 SessionId,
req: StageToolResultsRequest,
) -> Pin<Box<dyn Future<Output = Result<StageToolResultsResult, SessionError>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stage callback tool results for application on the next turn seam.
Implementations must persist the staged results durably before a live session can observe them so a failed call never leaves hidden pending transcript mutations behind.