pub struct SubTask {Show 14 fields
pub id: String,
pub name: String,
pub instruction: String,
pub specialty: Option<String>,
pub dependencies: Vec<String>,
pub priority: i32,
pub max_steps: usize,
pub context: SubTaskContext,
pub status: SubTaskStatus,
pub assigned_agent: Option<String>,
pub created_at: DateTime<Utc>,
pub completed_at: Option<DateTime<Utc>>,
pub stage: usize,
pub needs_worktree: Option<bool>,
}Expand description
A sub-task that can be executed by a sub-agent
Fields§
§id: StringUnique identifier
name: StringHuman-readable name/description
instruction: StringThe task instruction for the sub-agent
specialty: Option<String>Specialty/domain for this subtask
dependencies: Vec<String>Dependencies on other subtasks (by ID)
priority: i32Priority (higher = more important)
max_steps: usizeMaximum steps allowed for this subtask
context: SubTaskContextInput context from parent or dependencies
status: SubTaskStatusCurrent status
assigned_agent: Option<String>Assigned sub-agent ID
created_at: DateTime<Utc>Creation timestamp
completed_at: Option<DateTime<Utc>>Completion timestamp
stage: usizeStage in the execution plan (0 = can run immediately)
needs_worktree: Option<bool>Explicit override for whether this subtask needs an isolated
git worktree. None (the default) runs SubTask::needs_worktree
heuristics on specialty + instruction; Some(true) forces a
worktree; Some(false) forces the shared working directory.
Skipping the worktree for read-only tasks (research, review,
planning, fact-check) saves ~1s of setup, an inode, and
.git/worktrees lock contention when running many agents
in parallel. Tasks that edit files should keep the default or
explicitly request a worktree so their edits don’t collide with
sibling agents in the same swarm.
Implementations§
Source§impl SubTask
impl SubTask
Sourcepub fn new(name: impl Into<String>, instruction: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, instruction: impl Into<String>) -> Self
Create a new subtask
Sourcepub fn with_specialty(self, specialty: impl Into<String>) -> Self
pub fn with_specialty(self, specialty: impl Into<String>) -> Self
Add a specialty
Sourcepub fn with_dependencies(self, deps: Vec<String>) -> Self
pub fn with_dependencies(self, deps: Vec<String>) -> Self
Add dependencies
Sourcepub fn with_priority(self, priority: i32) -> Self
pub fn with_priority(self, priority: i32) -> Self
Set priority
Sourcepub fn with_max_steps(self, max_steps: usize) -> Self
pub fn with_max_steps(self, max_steps: usize) -> Self
Set max steps
Sourcepub fn with_context(self, context: SubTaskContext) -> Self
pub fn with_context(self, context: SubTaskContext) -> Self
Add context
Sourcepub fn with_needs_worktree(self, needs: bool) -> Self
pub fn with_needs_worktree(self, needs: bool) -> Self
Explicitly set whether this subtask needs a worktree.
true forces isolation; false forces the shared directory;
omit this call to fall back to SubTask::needs_worktree
heuristics. See the field docs on SubTask::needs_worktree
for why this matters in large swarms.
Sourcepub fn needs_worktree(&self) -> bool
pub fn needs_worktree(&self) -> bool
Decide whether this subtask should run in an isolated worktree.
Honours the explicit override when set; otherwise applies a conservative heuristic:
- Specialty keywords like
research,review,analy,audit,plan,fact,summari,search,explore,docsimply a read-only task → no worktree. - Instruction keywords like
write,edit,create,fix,implement,refactor,apply,commitimply file mutation → worktree. - Unknown tasks default to
true(worktree) to stay safe against accidental cross-agent edit collisions.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SubTask
impl<'de> Deserialize<'de> for SubTask
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SubTask
impl RefUnwindSafe for SubTask
impl Send for SubTask
impl Sync for SubTask
impl Unpin for SubTask
impl UnsafeUnpin for SubTask
impl UnwindSafe for SubTask
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request