pub struct TaskNode {
pub id: String,
pub description: String,
pub status: TaskStatus,
pub agent_config: AgentConfig,
pub depends_on: Vec<String>,
pub retry_count: u32,
pub result: Option<AgentResult>,
}Expand description
A single unit of work in the orchestration graph.
Each node carries:
- A stable string
id(used in dependency references). - A human-readable
descriptionfor the agent’s system context. - The
AgentConfigthat the executor will use when spinning up aCoderAgent. - A list of
depends_onIDs — edges in the DAG. - A mutable
statusupdated by the executor as the task progresses. - An optional
result(populated on success).
AgentResult is skipped in serialisation because it contains non-serialisable
futures/handles. Persist results separately if needed.
Fields§
§id: StringStable identifier. Must be unique within a TaskGraph.
Use lowercase-kebab-case by convention, e.g. "write-tests".
description: StringHuman-readable description shown to the agent and in progress displays.
status: TaskStatusCurrent lifecycle state.
agent_config: AgentConfigAgent configuration for this specific task (can differ per task — e.g. a “generate docs” task might use a smaller model or more iterations).
depends_on: Vec<String>IDs of tasks that must reach Completed before this task can start.
Validated as existing IDs when the node is added to a TaskGraph.
retry_count: u32Cumulative retry counter. Increments every time mark_failed is called
and persists across reset_for_retry calls so we can enforce a
per-task retry limit in the executor.
result: Option<AgentResult>Execution result populated by the executor upon success. Not serialised — reconstruct from session store if needed.
Implementations§
Source§impl TaskNode
impl TaskNode
Sourcepub fn new(id: impl Into<String>, description: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, description: impl Into<String>) -> Self
Create a minimal TaskNode with no dependencies and default AgentConfig.
Use the builder methods (with_dependency, with_config, with_description)
to customise before calling TaskGraph::add_task.
Sourcepub fn with_dependency(self, dep_id: impl Into<String>) -> Self
pub fn with_dependency(self, dep_id: impl Into<String>) -> Self
Add a single dependency by task ID.
The referenced task must exist in the TaskGraph by the time this node
is added to the graph — see TaskGraph::add_task.
Sourcepub fn with_config(self, config: AgentConfig) -> Self
pub fn with_config(self, config: AgentConfig) -> Self
Replace the default AgentConfig with a custom one.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Replace the description (useful when building nodes programmatically).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TaskNode
impl<'de> Deserialize<'de> for TaskNode
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 TaskNode
impl RefUnwindSafe for TaskNode
impl Send for TaskNode
impl Sync for TaskNode
impl Unpin for TaskNode
impl UnsafeUnpin for TaskNode
impl UnwindSafe for TaskNode
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