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: StringUnique identifier for this subagent instance.
name: StringSubagent name.
task: StringTask description.
started_at: InstantWhen the subagent started.
finished: boolWhether the subagent has finished.
success: boolWhether the subagent succeeded (only valid when finished).
result_summary: StringFinal result summary (only valid when finished).
tool_call_count: usizeTotal 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: u64Accumulated token count (input + output).
tick: usizeAnimation 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: boolWhether this subagent’s parent was sent to background (Ctrl+B).
Implementations§
Source§impl SubagentDisplayState
impl SubagentDisplayState
Sourcepub fn new(subagent_id: String, name: String, task: String) -> Self
pub fn new(subagent_id: String, name: String, task: String) -> Self
Create a new subagent display state.
Sourcepub fn display_label(&self) -> &str
pub fn display_label(&self) -> &str
Returns the short display label if set, otherwise the full task.
Sourcepub fn add_tool_call(
&mut self,
tool_name: String,
tool_id: String,
args: HashMap<String, Value>,
)
pub fn add_tool_call( &mut self, tool_name: String, tool_id: String, args: HashMap<String, Value>, )
Record a new tool call starting.
Sourcepub fn add_tokens(&mut self, input_tokens: u64, output_tokens: u64)
pub fn add_tokens(&mut self, input_tokens: u64, output_tokens: u64)
Accumulate token usage from an LLM call.
Sourcepub fn complete_tool_call(&mut self, tool_id: &str, success: bool)
pub fn complete_tool_call(&mut self, tool_id: &str, success: bool)
Record a tool call completing.
Sourcepub fn finish(
&mut self,
success: bool,
result_summary: String,
tool_call_count: usize,
shallow_warning: Option<String>,
)
pub fn finish( &mut self, success: bool, result_summary: String, tool_call_count: usize, shallow_warning: Option<String>, )
Mark the subagent as finished.
Sourcepub fn advance_tick(&mut self)
pub fn advance_tick(&mut self)
Advance the animation tick.
Sourcepub fn elapsed_secs(&self) -> u64
pub fn elapsed_secs(&self) -> u64
Elapsed time since start.
Sourcepub fn completion_summary(&self) -> String
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)”
Sourcepub fn activity_summary(&self) -> String
pub fn activity_summary(&self) -> String
Generate a summary of current activity.
Trait Implementations§
Source§impl Clone for SubagentDisplayState
impl Clone for SubagentDisplayState
Source§fn clone(&self) -> SubagentDisplayState
fn clone(&self) -> SubagentDisplayState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SubagentDisplayState
impl RefUnwindSafe for SubagentDisplayState
impl Send for SubagentDisplayState
impl Sync for SubagentDisplayState
impl Unpin for SubagentDisplayState
impl UnsafeUnpin for SubagentDisplayState
impl UnwindSafe for SubagentDisplayState
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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