Expand description
Subagent delegation: the built-in task tool.
Mirrors Flue’s Subagents: an agent
delegates a focused piece of work to a named subagent. The subagent runs in a
fresh child session and its answer returns to the parent as the task tool
result.
See docs/MVP4_SUBAGENTS_DESIGN.md for the full design and scope.
§Configuration inheritance (Flue-compatible)
Capability fields (instructions / tools / subagents) are
profile-owned — the parent’s values never flow into the delegated
session. Scalar defaults (model / config) inherit from the parent when
the profile omits them.
Structs§
- Subagent
Options - Options for the
TaskTool. - Subagent
Profile - A named, declarable subagent profile.
- Task
Tool - The built-in
tasktool, which also holds the delegation state.
Constants§
- DEFAULT_
MAX_ DELEGATIONS - Default cap on the total number of delegations across the whole tree.
Depth alone bounds chain length but not branching: a parent turn can issue
many parallel
taskcalls, each of which can do the same, producing exponential fan-out (up tomax_tool_calls_per_turn^max_depth≈ 10⁵ at defaults). This shared budget turns that into a hard ceiling regardless of depth or width. - DEFAULT_
MAX_ DEPTH - Default recursion limit. The top-level agent runs at depth 0; its
taskcalls run children at depth 1, etc. This matches the default in most agent harnesses and keeps runaway delegation bounded.