pub struct SpawnContext {
pub parent_messages: Vec<Message>,
pub parent_cancel: Option<CancellationToken>,
pub parent_provider_name: Option<String>,
pub spawn_depth: u32,
pub mcp_tool_names: Vec<String>,
}Expand description
Parent-derived state propagated to a spawned sub-agent.
All fields default to empty/None, preserving existing behavior when callers
pass SpawnContext::default().
Fields§
§parent_messages: Vec<Message>Recent parent conversation messages (last N turns).
parent_cancel: Option<CancellationToken>Parent’s cancellation token for linked cancellation (foreground spawns).
parent_provider_name: Option<String>Parent’s active provider name (for context propagation).
spawn_depth: u32Current spawn depth (0 = top-level agent).
mcp_tool_names: Vec<String>MCP tool names available in the parent’s tool executor (for diagnostics).
Trait Implementations§
Source§impl Default for SpawnContext
impl Default for SpawnContext
Source§fn default() -> SpawnContext
fn default() -> SpawnContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SpawnContext
impl RefUnwindSafe for SpawnContext
impl Send for SpawnContext
impl Sync for SpawnContext
impl Unpin for SpawnContext
impl UnsafeUnpin for SpawnContext
impl UnwindSafe for SpawnContext
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
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>
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 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>
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 moreSource§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