Skip to main content

RuntimeSteering

Struct RuntimeSteering 

Source
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

Source

pub fn set_receiver( &mut self, receiver: Option<UnboundedReceiver<SteeringMessage>>, )

Replace the steering message receiver channel.

Source

pub fn take_receiver(&mut self) -> Option<UnboundedReceiver<SteeringMessage>>

Take ownership of the steering receiver, leaving None in its place.

Source

pub fn open_admission(&mut self)

Reopen admission for a new turn. Called once at turn setup.

Source

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.

Source

pub const fn admission_closed(&self) -> bool

Source

pub fn set_cancellation_precedence(&mut self, value: bool)

Declare that cancellation outranks any pending steer until the next Self::open_admission.

Source

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.

Source

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.

Source

pub fn has_pending_follow_up_inputs(&self) -> bool

Source

pub fn pop_follow_up_input(&mut self) -> Option<String>

Dequeue the next follow-up user input, if any are pending.

Source

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).

Source

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.

Source

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.

Source

pub fn try_queue_synthetic_follow_up_input( &mut self, input: String, ) -> Result<(), FollowUpQueueFull>

Queue a harness-generated continuation or recovery instruction.

Source

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.

Source

pub fn try_queue_recovered_follow_up( &mut self, intent: QueuedFollowUpIntent, ) -> Result<(), FollowUpQueueFull>

Reserve one additional slot for an interrupted, already accepted input.

Source

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.

Source

pub fn applied_follow_up_intent_ids(&self) -> &VecDeque<String>

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn clear_pending_follow_up_inputs(&mut self)

Source

pub async fn poll_turn_control(&mut self) -> RuntimeControl

Poll the steering channel for control signals during the current turn.

Source

pub async fn poll_tool_control(&mut self) -> RuntimeControl

Poll the steering channel for control signals during tool execution.

Trait Implementations§

Source§

impl Default for RuntimeSteering

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> PtyHandle for T
where T: Send,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WasmCompatSend for T
where T: Send,

Source§

impl<T> WasmCompatSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more