pub struct SubAgentTracker { /* private fields */ }Expand description
管理所有运行中的子 Agent 快照,供 /dump 读取。
仅追踪 AgentTool 创建的临时子代理(SubAgent),不含 Teammate
(Teammate 由 TeammateManager 独立管理)。
Implementations§
Source§impl SubAgentTracker
impl SubAgentTracker
Sourcepub fn allocate_id(&self) -> String
pub fn allocate_id(&self) -> String
分配一个新的 sub_id(不注册,仅递增计数器)。
用于在注册前提前确定 sub_id,以便构建子 agent 独立存储路径(transcript、todos)。
Sourcepub fn register_with_id(
&self,
id: String,
description: &str,
mode: &'static str,
) -> SubAgentHandle
pub fn register_with_id( &self, id: String, description: &str, mode: &'static str, ) -> SubAgentHandle
使用已分配的 id 注册子 Agent;返回 Handle 集合。
Sourcepub fn snapshot_running(&self) -> Vec<RunningSubAgentDump> ⓘ
pub fn snapshot_running(&self) -> Vec<RunningSubAgentDump> ⓘ
采集当前所有仍在运行的子 Agent 的完整快照(供 /dump 使用)
Sourcepub fn display_snapshots(&self) -> Vec<SubAgentDisplay>
pub fn display_snapshots(&self) -> Vec<SubAgentDisplay>
采集所有子 Agent(含刚完成的)的 UI 展示快照
Sourcepub fn gc_finished(&self)
pub fn gc_finished(&self)
清理已结束的子 Agent(可在 register 时调用,防止列表无限增长)
保留完成/错误状态超过 30 秒后清理,给 UI 显示终态的时间。
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for SubAgentTracker
impl RefUnwindSafe for SubAgentTracker
impl Send for SubAgentTracker
impl Sync for SubAgentTracker
impl Unpin for SubAgentTracker
impl UnsafeUnpin for SubAgentTracker
impl UnwindSafe for SubAgentTracker
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.