pub struct RuntimeSessionLifecycle<A: RuntimeHostAdapter> { /* private fields */ }Expand description
Shared lifecycle helper for runtime-backed hosts.
Implementations§
Source§impl<A: RuntimeHostAdapter> RuntimeSessionLifecycle<A>
impl<A: RuntimeHostAdapter> RuntimeSessionLifecycle<A>
pub fn new(adapter: A, org_id: i64, session_id: SessionId) -> Self
pub async fn turn_started(&self, turn_id: TurnId, input_message_id: MessageId)
pub async fn emit_turn_completed( &self, input_message_id: MessageId, data: TurnCompletedData, )
pub async fn emit_session_idled( &self, turn_id: TurnId, input_message_id: MessageId, iterations: Option<u32>, usage: Option<TokenUsage>, )
pub async fn turn_completed( &self, turn_id: TurnId, input_message_id: MessageId, iterations: u32, usage: Option<TokenUsage>, input_content: Option<String>, )
Sourcepub async fn fire_turn_end_hooks(
&self,
harness_id: HarnessId,
agent_id: Option<AgentId>,
turn_id: TurnId,
success: bool,
)
pub async fn fire_turn_end_hooks( &self, harness_id: HarnessId, agent_id: Option<AgentId>, turn_id: TurnId, success: bool, )
Fire turn_end lifecycle hooks (advisory). Collects the session’s hook
specs and runs every turn_end hook; failures are logged, never fatal.
harness_id/agent_id are required to resolve the capability chain.
Sourcepub async fn user_prompt_blocked(
&self,
turn_id: TurnId,
input_message_id: MessageId,
reason: &str,
user_message: Option<&str>,
)
pub async fn user_prompt_blocked( &self, turn_id: TurnId, input_message_id: MessageId, reason: &str, user_message: Option<&str>, )
Abort a turn because a user_prompt_submit hook returned Block.
Reuses the dependency-blocked failure shape: emit a user-facing message
carrying the hook’s user_message (or reason), then mark the turn
failed and idle the session.
pub async fn turn_failed( &self, turn_id: TurnId, input_message_id: MessageId, error: &str, user_error: Option<&UserFacingError>, )
pub async fn waiting_for_tool_results(&self)
pub async fn dependency_blocked( &self, turn_id: TurnId, input_message_id: MessageId, blocker: DependencyBlocker, )
Auto Trait Implementations§
impl<A> Freeze for RuntimeSessionLifecycle<A>where
A: Freeze,
impl<A> RefUnwindSafe for RuntimeSessionLifecycle<A>where
A: RefUnwindSafe,
impl<A> Send for RuntimeSessionLifecycle<A>
impl<A> Sync for RuntimeSessionLifecycle<A>
impl<A> Unpin for RuntimeSessionLifecycle<A>where
A: Unpin,
impl<A> UnsafeUnpin for RuntimeSessionLifecycle<A>where
A: UnsafeUnpin,
impl<A> UnwindSafe for RuntimeSessionLifecycle<A>where
A: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request