SubAgents
class SubAgents(val agents: List<SubAgent>, val toolName: String = DELEGATE_TASK, clock: () -> Long = System::currentTimeMillis) : Capability(source)
Lets the agent delegate self-contained tasks to named agents — the same contract as Pydantic AI Harness SubAgents, so on-device and server agents behave alike and UIs render both the same way:
one tool,
delegate_task(agent_name, task);the roster is a static instruction (cache-stable);
each delegation runs in a fresh context and returns the delegate's final answer to the parent.
While a delegation runs, its reply streams to the UI through ToolCallContext.subagent and is rendered by the Subagent element.
Constructors
Functions
Link copied to clipboard
Per-turn context read when a turn starts (e.g. a memory snapshot), placed after the static instructions. It may change between turns, so keep it small and at the end.