Skip to main content

SubagentDisplayState

Struct SubagentDisplayState 

Source
pub struct SubagentDisplayState {
Show 17 fields pub subagent_id: String, pub name: String, pub task: String, pub started_at: Instant, pub finished: bool, pub success: bool, pub result_summary: String, pub tool_call_count: usize, pub active_tools: HashMap<String, NestedToolCallState>, pub completed_tools: Vec<CompletedToolCall>, pub token_count: u64, pub tick: usize, pub shallow_warning: Option<String>, pub finished_at: Option<Instant>, pub parent_tool_id: Option<String>, pub description: Option<String>, pub backgrounded: bool,
}
Expand description

State tracking for a single subagent execution.

Fields§

§subagent_id: String

Unique identifier for this subagent instance.

§name: String

Subagent name.

§task: String

Task description.

§started_at: Instant

When the subagent started.

§finished: bool

Whether the subagent has finished.

§success: bool

Whether the subagent succeeded (only valid when finished).

§result_summary: String

Final result summary (only valid when finished).

§tool_call_count: usize

Total tool calls made.

§active_tools: HashMap<String, NestedToolCallState>

Active tool calls (tool_id -> NestedToolCallState).

§completed_tools: Vec<CompletedToolCall>

Completed tool calls (for display).

§token_count: u64

Accumulated token count (input + output).

§tick: usize

Animation tick counter for spinner.

§shallow_warning: Option<String>

Optional shallow subagent warning.

§finished_at: Option<Instant>

When the subagent finished (for cleanup timing).

§parent_tool_id: Option<String>

The parent spawn_subagent tool_id (set when SubagentStarted is linked to ToolStarted).

§description: Option<String>

Short display label (from description param), used instead of full task in spinner.

§backgrounded: bool

Whether this subagent’s parent was sent to background (Ctrl+B).

Implementations§

Source§

impl SubagentDisplayState

Source

pub fn new(subagent_id: String, name: String, task: String) -> Self

Create a new subagent display state.

Source

pub fn display_label(&self) -> &str

Returns the short display label if set, otherwise the full task.

Source

pub fn add_tool_call( &mut self, tool_name: String, tool_id: String, args: HashMap<String, Value>, )

Record a new tool call starting.

Source

pub fn add_tokens(&mut self, input_tokens: u64, output_tokens: u64)

Accumulate token usage from an LLM call.

Source

pub fn complete_tool_call(&mut self, tool_id: &str, success: bool)

Record a tool call completing.

Source

pub fn finish( &mut self, success: bool, result_summary: String, tool_call_count: usize, shallow_warning: Option<String>, )

Mark the subagent as finished.

Source

pub fn advance_tick(&mut self)

Advance the animation tick.

Source

pub fn elapsed_secs(&self) -> u64

Elapsed time since start.

Source

pub fn completion_summary(&self) -> String

Generate a persistent completion summary for display after the subagent finishes. Format: “Done (N tool uses, Xs, N.Nk tokens)”

Source

pub fn activity_summary(&self) -> String

Generate a summary of current activity.

Trait Implementations§

Source§

impl Clone for SubagentDisplayState

Source§

fn clone(&self) -> SubagentDisplayState

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SubagentDisplayState

Source§

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

Formats the value using the given formatter. 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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
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> 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> 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: 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: 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.
Source§

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

Source§

fn vzip(self) -> V

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