Expand description
Sub-agent nodes — the graph node that delegates to a harness agent (a
model-driven agent loop) resolved by name from a
CapabilityRegistry.
Where crate::graph::subgraph embeds an entire [CompiledGraph] as a
node, this module embeds a harness agent as a node: a graph step hands its
work to a registered, independently-observable agent and folds the agent’s
answer back into the parent graph state.
The pieces:
SubAgentNodebinds an agentComponentIdto anInputMapper(parentState→SubAgentInput), anOutputMapper(SubAgentOutput→ parentUpdate), and aSubAgentPolicy.subagent_nodelowers aSubAgentNode+ a registry into an ordinary graph node [Handler]: it resolves the agent by name, creates a distinct childrun_idthat preserves the run tree’sroot_run_idand is parented to the enclosing graph run, applies timeout/retry/budget policy, maps the child output into the parent update, records the child run (with its usage) onto the parent execution rollup, and forwards the child run’s harness events onto the node’s event sink.HarnessSubAgentadapts a harnessSubAgentinto a registry-storableHarnessAgent.
See [types] for the data definitions and test.rs for focused tests.
Structs§
- Harness
SubAgent - Adapts a harness
SubAgentinto a registry-storableHarnessAgent. - SubAgent
Budget - An optional cap on the work a single sub-agent invocation may perform.
- SubAgent
Input - The structured input a
SubAgentNodehands to a delegated agent. - SubAgent
Node - A graph node that delegates to a harness agent resolved by name.
- SubAgent
Output - The structured output a delegated agent returns to its
SubAgentNode. - SubAgent
Policy - Timeout, retry, and budget policy applied around a sub-agent invocation.
Traits§
- Harness
Agent - A harness agent invocable by name from a graph node.
Functions§
- subagent_
node - Lowers a
SubAgentNodeplus a capabilityregistryinto a graph node [Handler].
Type Aliases§
- Input
Mapper - Maps parent graph
Stateinto theSubAgentInputa delegated agent runs over. - Output
Mapper - Maps a delegated agent’s
SubAgentOutputinto the parent graphUpdatemerged through the graph reducer.