pub struct RuntimeSteering { /* private fields */ }Expand description
Manages steering messages (stop, pause, resume, follow-up inputs) for a running agent turn.
Implementations§
Source§impl RuntimeSteering
impl RuntimeSteering
Sourcepub fn set_receiver(
&mut self,
receiver: Option<UnboundedReceiver<SteeringMessage>>,
)
pub fn set_receiver( &mut self, receiver: Option<UnboundedReceiver<SteeringMessage>>, )
Replace the steering message receiver channel.
Sourcepub fn take_receiver(&mut self) -> Option<UnboundedReceiver<SteeringMessage>>
pub fn take_receiver(&mut self) -> Option<UnboundedReceiver<SteeringMessage>>
Take ownership of the steering receiver, leaving None in its place.
Sourcepub fn open_admission(&mut self)
pub fn open_admission(&mut self)
Reopen admission for a new turn. Called once at turn setup.
Sourcepub fn close_admission(&mut self)
pub fn close_admission(&mut self)
Close admission atomically with the final steering drain. Later arrivals are rejected rather than left stranded in the channel.
pub const fn admission_closed(&self) -> bool
Sourcepub fn set_cancellation_precedence(&mut self, value: bool)
pub fn set_cancellation_precedence(&mut self, value: bool)
Declare that cancellation outranks any pending steer until the next
Self::open_admission.
Sourcepub fn drain_rejected_steers(&mut self)
pub fn drain_rejected_steers(&mut self)
Reject steers that arrived after admission closed but before the next turn reopens it. Without this drain a late arrival would be admitted into the following turn instead of being rejected as intended.
Sourcepub fn admit_follow_up_steer(
&mut self,
steer: FollowUpSteer,
) -> Option<QueuedFollowUpIntent>
pub fn admit_follow_up_steer( &mut self, steer: FollowUpSteer, ) -> Option<QueuedFollowUpIntent>
The single authoritative admission point for a live steer.
Checks the admission gate and capacity, queues the intent with a fresh
identity, and resolves the receipt with exactly one terminal outcome.
Returns the admitted intent so callers can apply it to model-facing
history; None means the steer was rejected and the sender must fall
back to its own queue.
pub fn has_pending_follow_up_inputs(&self) -> bool
Sourcepub fn pop_follow_up_input(&mut self) -> Option<String>
pub fn pop_follow_up_input(&mut self) -> Option<String>
Dequeue the next follow-up user input, if any are pending.
Sourcepub fn pop_follow_up_intent(&mut self) -> Option<QueuedFollowUpIntent>
pub fn pop_follow_up_intent(&mut self) -> Option<QueuedFollowUpIntent>
Dequeue the next identified follow-up intent.
Refills the primary FIFO from overflow first so an empty primary with
parked overflow still yields (has_pending_follow_up_inputs staying
true must not race a None pop).
Sourcepub fn queue_follow_up_input(&mut self, input: String) -> bool
pub fn queue_follow_up_input(&mut self, input: String) -> bool
Queue a follow-up user input. The boolean is false when the FIFO is
full; callers that need the error detail should use the try_ variant.
Sourcepub fn try_queue_follow_up_input(
&mut self,
input: String,
) -> Result<(), FollowUpQueueFull>
pub fn try_queue_follow_up_input( &mut self, input: String, ) -> Result<(), FollowUpQueueFull>
Queue a follow-up user input and return an explicit overflow error.
Sourcepub fn try_queue_synthetic_follow_up_input(
&mut self,
input: String,
) -> Result<(), FollowUpQueueFull>
pub fn try_queue_synthetic_follow_up_input( &mut self, input: String, ) -> Result<(), FollowUpQueueFull>
Queue a harness-generated continuation or recovery instruction.
Sourcepub fn try_queue_follow_up_intent(
&mut self,
intent: QueuedFollowUpIntent,
) -> Result<(), FollowUpQueueFull>
pub fn try_queue_follow_up_intent( &mut self, intent: QueuedFollowUpIntent, ) -> Result<(), FollowUpQueueFull>
Queue a recovered intent without changing its stable identity.
Primary FIFO first; when it is full the intent parks in a bounded overflow buffer so rapid influx is preserved rather than dropped. Only when both buffers are full does the call fail.
Sourcepub fn try_queue_recovered_follow_up(
&mut self,
intent: QueuedFollowUpIntent,
) -> Result<(), FollowUpQueueFull>
pub fn try_queue_recovered_follow_up( &mut self, intent: QueuedFollowUpIntent, ) -> Result<(), FollowUpQueueFull>
Reserve one additional slot for an interrupted, already accepted input.
Sourcepub fn acknowledge_follow_up_intent(&mut self, intent_id: impl Into<String>)
pub fn acknowledge_follow_up_intent(&mut self, intent_id: impl Into<String>)
Mark an intent as applied after its tagged user message is stored.
pub fn applied_follow_up_intent_ids(&self) -> &VecDeque<String>
Sourcepub fn pending_follow_up_intents(&self) -> &VecDeque<QueuedFollowUpIntent>
pub fn pending_follow_up_intents(&self) -> &VecDeque<QueuedFollowUpIntent>
Primary-FIFO view of pending follow-ups (excludes overflow park and
in-flight). Prefer Self::pending_follow_up_intents_snapshot when
the complete unwritten set matters.
Sourcepub fn pending_follow_up_intents_snapshot(&self) -> Vec<QueuedFollowUpIntent>
pub fn pending_follow_up_intents_snapshot(&self) -> Vec<QueuedFollowUpIntent>
Return all accepted intents that are not yet represented by durable session history, including the intent currently being processed and any parked in the overflow buffer.
Sourcepub fn drain_follow_up_intents_to_in_flight(
&mut self,
) -> Vec<QueuedFollowUpIntent>
pub fn drain_follow_up_intents_to_in_flight( &mut self, ) -> Vec<QueuedFollowUpIntent>
Pop every queued follow-up intent and move it to the in-flight queue, returning the intents for immediate application to live history (mid-turn steering). Until the post-turn history checkpoint succeeds, the moved intents stay in the pending snapshot exactly like turn-boundary delivery.
Sourcepub fn acknowledge_durable_follow_up_intents(&mut self)
pub fn acknowledge_durable_follow_up_intents(&mut self)
Mark intents whose tagged user messages have been durably checkpointed as applied. Until this is called, the intents remain in the pending snapshot so a crash cannot lose them between history and envelope IO.
Sourcepub fn release_in_flight_follow_up_intents_without_persistence(&mut self)
pub fn release_in_flight_follow_up_intents_without_persistence(&mut self)
Release intents after their tagged messages have been applied when no history archive exists. This frees FIFO capacity for the in-process session without adding applied IDs that could falsely imply crash durability.
pub fn clear_pending_follow_up_inputs(&mut self)
Sourcepub async fn poll_turn_control(&mut self) -> RuntimeControl
pub async fn poll_turn_control(&mut self) -> RuntimeControl
Poll the steering channel for control signals during the current turn.
Sourcepub async fn poll_tool_control(&mut self) -> RuntimeControl
pub async fn poll_tool_control(&mut self) -> RuntimeControl
Poll the steering channel for control signals during tool execution.
Trait Implementations§
Auto Trait Implementations§
impl Forget for RuntimeSteering
impl Freeze for RuntimeSteering
impl Move for RuntimeSteering
impl RefUnwindSafe for RuntimeSteering
impl Send for RuntimeSteering
impl Sync for RuntimeSteering
impl Unpin for RuntimeSteering
impl UnsafeUnpin for RuntimeSteering
impl UnwindSafe for RuntimeSteering
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more