Documentation
¶
Overview ¶
Example: subagents demonstrates context-isolated delegation (WC-A-003). A parent agent delegates a research sub-task to a subagent with spawn_subagent. The subagent works in its OWN fresh conversation and returns only its final result — its intermediate reasoning never enters the parent's context window.
A single deterministic mock model.Provider drives both roles (subagents inherit the parent's model), routing on the system prompt, so the example runs with NO API keys and NO network:
parent turn 0: delegate "research Go's history" via spawn_subagent subagent: (fresh context) produce a one-line finding parent turn 1: answer using only the returned finding go run ./examples/subagents/
Click to show internal directories.
Click to hide internal directories.