Skip to main content

SubagentFilter

Struct SubagentFilter 

Source
pub struct SubagentFilter { /* private fields */ }
Expand description

The transformer behind SubagentVisibility.

Both modes keep the consuming normalizer’s model of the stream — one open chunk-continuable stream per owner — because a *_CHUNK event that names no id is resolved through its attribution on the consuming side, and stripping the attribution would send it to the wrong stream. Such a chunk is given the id it resolves to (and, for a tool call, the name the consumer needs to reopen it) before its tag goes.

Hidden additionally remembers what each subagent owns — messages, tool calls, activities — for the rest of the run, not only while they are open, so an untagged continuation, re-open, patch or result for a subagent’s entity is dropped with the rest of it rather than leaking into the parent’s stream. That is the owner-aware verifier’s reading too: the first writer owns the id, and an absent tag agrees with any owner. An entity the consumer has seen opened keeps that visibility until it closes, whatever a snapshot says about its owner meanwhile — a consumer must never be left with a message it saw opened and never sees closed.

Implementations§

Source§

impl SubagentFilter

Source

pub fn new(mode: SubagentVisibility) -> Self

A filter for mode.

Source

pub fn mode(&self) -> SubagentVisibility

The mode this filter applies.

Trait Implementations§

Source§

impl Debug for SubagentFilter

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl StreamTransformer for SubagentFilter

Source§

fn transform(&mut self, event: Event) -> Vec<Event>

Rewrites one event into zero or more events.

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

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

§

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
§

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, 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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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