pub struct SubagentConfig { /* private fields */ }Expand description
Runtime configuration for subagent delegation limits.
Implementations§
Source§impl SubagentConfig
impl SubagentConfig
Sourcepub fn new(max_threads: usize, max_depth: u8) -> Result<Self, SubagentError>
pub fn new(max_threads: usize, max_depth: u8) -> Result<Self, SubagentError>
Creates validated subagent limit configuration.
Sourcepub fn with_limit_behavior(self, behavior: SubagentLimitBehavior) -> Self
pub fn with_limit_behavior(self, behavior: SubagentLimitBehavior) -> Self
Sets admission behavior when a batch exceeds max_threads.
Sourcepub fn with_max_total_tokens(
self,
max_total_tokens: Option<u64>,
) -> Result<Self, SubagentError>
pub fn with_max_total_tokens( self, max_total_tokens: Option<u64>, ) -> Result<Self, SubagentError>
Sets an optional per-child cumulative token circuit breaker.
Sourcepub fn with_default_timeout_secs(
self,
timeout_secs: Option<u64>,
) -> Result<Self, SubagentError>
pub fn with_default_timeout_secs( self, timeout_secs: Option<u64>, ) -> Result<Self, SubagentError>
Sets an optional default wall-clock timeout in seconds for child tasks.
Sourcepub fn with_foreground_wait_budget_secs(
self,
budget_secs: u64,
) -> Result<Self, SubagentError>
pub fn with_foreground_wait_budget_secs( self, budget_secs: u64, ) -> Result<Self, SubagentError>
Sets the foreground wait budget in seconds before wait: "all" | "any"
gracefully hands off running children to the background.
Sourcepub fn with_max_model_turns(
self,
max_model_turns: u32,
) -> Result<Self, SubagentError>
pub fn with_max_model_turns( self, max_model_turns: u32, ) -> Result<Self, SubagentError>
Replaces the default model-turn budget inherited by child tasks that
omit an explicit max_model_turns value.
Sourcepub fn with_min_model_turns(
self,
min_model_turns: u32,
) -> Result<Self, SubagentError>
pub fn with_min_model_turns( self, min_model_turns: u32, ) -> Result<Self, SubagentError>
Replaces the minimum model-turn budget accepted for explicit child tasks.
Sourcepub fn with_model_turn_bounds(
self,
min_model_turns: u32,
max_model_turns: u32,
) -> Result<Self, SubagentError>
pub fn with_model_turn_bounds( self, min_model_turns: u32, max_model_turns: u32, ) -> Result<Self, SubagentError>
Replaces both model-turn bounds in one validated operation.
Sourcepub fn validate_task_max_model_turns(
self,
requested: u32,
) -> Result<(), SubagentError>
pub fn validate_task_max_model_turns( self, requested: u32, ) -> Result<(), SubagentError>
Validates one explicit child budget against this runtime configuration.
Sourcepub fn min_model_turns(self) -> u32
pub fn min_model_turns(self) -> u32
Returns the minimum model-turn budget accepted for an explicit child task.
Sourcepub fn max_threads(self) -> usize
pub fn max_threads(self) -> usize
Returns the maximum number of child agents allowed to run concurrently.
Sourcepub fn max_model_turns(self) -> u32
pub fn max_model_turns(self) -> u32
Returns the default maximum number of model turns for one child task.
Sourcepub fn default_timeout_secs(self) -> Option<u64>
pub fn default_timeout_secs(self) -> Option<u64>
Returns the optional default wall-clock timeout in seconds for child tasks.
Sourcepub fn foreground_wait_budget_secs(self) -> u64
pub fn foreground_wait_budget_secs(self) -> u64
Returns the foreground wait budget in seconds.
Sourcepub fn limit_behavior(self) -> SubagentLimitBehavior
pub fn limit_behavior(self) -> SubagentLimitBehavior
Returns admission behavior when max_threads is full.
Sourcepub fn max_total_tokens(self) -> Option<u64>
pub fn max_total_tokens(self) -> Option<u64>
Returns the optional per-child cumulative token circuit breaker.
Trait Implementations§
Source§impl Clone for SubagentConfig
impl Clone for SubagentConfig
impl Copy for SubagentConfig
Source§impl Debug for SubagentConfig
impl Debug for SubagentConfig
Source§impl Default for SubagentConfig
impl Default for SubagentConfig
impl Eq for SubagentConfig
Source§impl PartialEq for SubagentConfig
impl PartialEq for SubagentConfig
impl StructuralPartialEq for SubagentConfig
Auto Trait Implementations§
impl Forget for SubagentConfig
impl Freeze for SubagentConfig
impl Move for SubagentConfig
impl RefUnwindSafe for SubagentConfig
impl Send for SubagentConfig
impl Sync for SubagentConfig
impl Unpin for SubagentConfig
impl UnsafeUnpin for SubagentConfig
impl UnwindSafe for SubagentConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.