pub struct SubagentManager { /* private fields */ }Expand description
Subagent manager for background task execution.
Subagents are lightweight agent instances that run in the background to handle specific tasks. They share the same LLM provider but have isolated context and a focused system prompt.
Implementations§
Source§impl SubagentManager
impl SubagentManager
Sourcepub fn new(
provider: Arc<dyn LLMProvider>,
workspace: PathBuf,
bus: MessageBus,
model: Option<String>,
network_config: NetworkToolConfig,
exec_timeout: Option<u64>,
restrict_to_workspace: bool,
) -> Self
pub fn new( provider: Arc<dyn LLMProvider>, workspace: PathBuf, bus: MessageBus, model: Option<String>, network_config: NetworkToolConfig, exec_timeout: Option<u64>, restrict_to_workspace: bool, ) -> Self
Create a new subagent manager
pub async fn update_network_config(&self, network_config: NetworkToolConfig)
Sourcepub async fn spawn(
&self,
task: String,
label: Option<String>,
origin_channel: String,
origin_chat_id: String,
) -> Result<String>
pub async fn spawn( &self, task: String, label: Option<String>, origin_channel: String, origin_chat_id: String, ) -> Result<String>
Spawn a subagent to execute a task in the background.
§Arguments
task- The task description for the subagentlabel- Optional human-readable label for the taskorigin_channel- The channel to announce results toorigin_chat_id- The chat ID to announce results to
§Returns
Status message indicating the subagent was started
Sourcepub async fn get_running_count(&self) -> usize
pub async fn get_running_count(&self) -> usize
Get the number of currently running subagents
Auto Trait Implementations§
impl Freeze for SubagentManager
impl !RefUnwindSafe for SubagentManager
impl Send for SubagentManager
impl Sync for SubagentManager
impl Unpin for SubagentManager
impl UnsafeUnpin for SubagentManager
impl !UnwindSafe for SubagentManager
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> 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>
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 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>
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