Skip to main content

Module subagent

Module subagent 

Source
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§

SubagentOptions
Options for the TaskTool.
SubagentProfile
A named, declarable subagent profile.
TaskTool
The built-in task tool, 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 task calls, each of which can do the same, producing exponential fan-out (up to max_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 task calls run children at depth 1, etc. This matches the default in most agent harnesses and keeps runaway delegation bounded.