Skip to main content

SubAgentOp

Enum SubAgentOp 

Source
pub enum SubAgentOp {
    Spawn {
        args: Box<SpawnArgs>,
        parent_run_id: String,
        max_depth: usize,
        reply: Sender<Result<String, String>>,
    },
    Check {
        run_id: String,
        reply: Sender<Option<AgentStatus>>,
    },
    Send {
        run_id: String,
        caller_run_id: String,
        content: String,
        reply: Sender<bool>,
    },
    Kill {
        run_id: String,
        caller_run_id: String,
        reply: Sender<bool>,
    },
}
Expand description

A world-access request from an agent’s tool lane. The sub-agent tools (spawn_agent/check_agent/send_to_agent/kill_agent) need the world and the Spawner, which only the host holds - the tool lane runs async, off the world. Each carries a oneshot reply, so the (sequential) tool lane blocks on the host applying it, mirroring the interaction hub.

Variants§

§

Spawn

Spawn a child agent from args, linked as a child of parent_run_id. Rejected if the child would exceed max_depth. Reply is the child run id.

Fields

§args: Box<SpawnArgs>

The child’s spawn parameters (blueprint path, task, etc.). Boxed because it is much larger than the other variants’ payloads.

§parent_run_id: String

The run id of the agent doing the spawning.

§max_depth: usize

Maximum allowed sub-agent tree depth (root = 0).

§reply: Sender<Result<String, String>>

Reply: the child’s run id, or an error message.

§

Check

Report a run’s current status (None if the host has no such live run).

Fields

§run_id: String

The run to query.

§reply: Sender<Option<AgentStatus>>

Reply: the run’s status.

§

Send

Deliver a message into a running agent’s inbox. Reply is whether a live agent accepted it.

Fields

§run_id: String

The target run.

§caller_run_id: String

The run doing the sending. The target must be it or one of its descendants - see WorldHost::is_within_tree.

§content: String

The message body.

§reply: Sender<bool>

Reply: whether the message was accepted.

§

Kill

Cancel a run and its whole sub-tree. Reply is whether any agent was found.

Fields

§run_id: String

The run to cancel (with its descendants).

§caller_run_id: String

The run doing the cancelling. The target must be it or one of its descendants - see WorldHost::is_within_tree.

§reply: Sender<bool>

Reply: whether anything was cancelled.

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> ConditionalSend for T
where T: Send,

Source§

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

Source§

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

Converts Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Converts Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

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

Converts &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> DowncastSend for T
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<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, 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> IntoResult<T> for T

Source§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<A> Is for A
where A: Any,

Source§

fn is<T>() -> bool
where T: Any,

Checks if the current type “is” another type, using a TypeId equality comparison. This is most useful in the context of generic logic. 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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