Struct ToolLoop
pub struct ToolLoop<'a> {Show 19 fields
pub exec: ResolvedAgentExecution<'a>,
pub history: &'a mut Vec<ChatMessage>,
pub channel_name: &'a str,
pub channel_reply_target: Option<&'a str>,
pub cancellation_token: Option<CancellationToken>,
pub on_delta: Option<Sender<StreamDelta>>,
pub shared_budget: Option<Arc<Atomic<usize>>>,
pub channel: Option<&'a dyn Channel>,
pub collected_receipts: Option<&'a Mutex<Vec<String>>>,
pub event_tx: Option<Sender<TurnEvent>>,
pub steering: Option<&'a mut Receiver<String>>,
pub new_messages_out: Option<&'a mut Vec<ChatMessage>>,
pub image_cache: Option<&'a mut LocalImageCache>,
pub ingress: IngressContext,
pub memory: Option<TurnMemory<'a>>,
pub agent_alias: Option<&'a str>,
pub parent_agent_alias: Option<&'a str>,
pub turn_id: &'a str,
pub sop_reassembly: Option<SopStepReassembly<'a>>,
}Fields§
§exec: ResolvedAgentExecution<'a>The resolved per-agent execution context: model binding, gated tool
registry, approval, observability, and resolved runtime knobs. Stable
for every turn to this agent; built once and reused. See
ResolvedAgentExecution. Everything below is per-message turn state.
history: &'a mut Vec<ChatMessage>§channel_name: &'a str§channel_reply_target: Option<&'a str>§cancellation_token: Option<CancellationToken>§on_delta: Option<Sender<StreamDelta>>§channel: Option<&'a dyn Channel>§collected_receipts: Option<&'a Mutex<Vec<String>>>§event_tx: Option<Sender<TurnEvent>>§steering: Option<&'a mut Receiver<String>>§new_messages_out: Option<&'a mut Vec<ChatMessage>>§image_cache: Option<&'a mut LocalImageCache>§ingress: IngressContext§memory: Option<TurnMemory<'a>>The per-turn memory half for unified memory-context injection: the
handle, raw recall query, session scopes, and spawn-site suppression.
None for nested sub-turn sites and paths without a memory backend;
the injection decision itself is keyed on ingress.origin.
agent_alias: Option<&'a str>Observer metadata: agent alias and turn id, stamped onto every turn-level observer event so OTel spans correlate across the loop. This is the EFFECTIVE agent — the one whose policy/tools/provider this loop actually runs with. A nested cross-agent SOP step runs its sub-loop with the step agent here, never the delegating parent’s.
parent_agent_alias: Option<&'a str>The delegating agent’s alias when this loop is a nested cross-agent
execution (a live SOP step naming a different agent). Stamped next to
agent_alias on observer records so security/audit consumers see both
the acting authority and its parent. None for ordinary turns.
turn_id: &'a str§sop_reassembly: Option<SopStepReassembly<'a>>Handle the live SOP driver uses to re-assemble a nested step’s execution
context when the step delegates to a different agent (see
SopStepReassembly). None on every path that cannot reach Config
or that never drives nested SOP steps; when None, a cross-agent step
FAILS CLOSED (the step errors rather than running with the parent
agent’s broader context).
Auto Trait Implementations§
impl<'a> Freeze for ToolLoop<'a>
impl<'a> !RefUnwindSafe for ToolLoop<'a>
impl<'a> Send for ToolLoop<'a>
impl<'a> Sync for ToolLoop<'a>
impl<'a> Unpin for ToolLoop<'a>
impl<'a> UnsafeUnpin for ToolLoop<'a>
impl<'a> !UnwindSafe for ToolLoop<'a>
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<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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