delegate spawns a child run. One verb covers what used to be three separate spawn tools, and the distinction that matters is what the child is:
A model child gets its own session — a real thread with its own Log. Its brief is markdown that becomes the child's first message verbatim — no JSON envelope, no summarization. The prompt is the interface, and what the parent wrote is exactly what the child reads.
A script child (a script is present) runs in the deterministic QuickJS engine with a journal — see Scripts and the Journal.
await: false detaches a model child: the parent does not park on it, but the child stays in the run tree, visible and cancellable. Script children cannot be detached — "scripts are awaited" — and asking is an error rather than a silent behavior change.
Spawning is bounded: three levels deep, ten children per session.
Finding a child while it works
Each child run records parent_tool_call_id, the id of the tool call that spawned it. That is what lets a delegate row in the transcript find its child before any result exists, so a delegation is a door while the child works, not only after it finishes.
The same field is how the result gets home: when the child finalizes, its outcome is appended as the tool_result on the parent's transcript and the parent's wait set shrinks by that call id. When the last one clears, the parent resumes.
If a child session is later resumed by a new message or a retry, the delegation contract is re-derived by walking up through sessions.run_id — so a child always knows which parent call it owes an answer to, even across restarts.
Typed results
A child spawned with an output schema owes a typed result: it must deliver through the return_result tool, and validation failures bounce back for self-correction, up to three attempts before the child gives up with Result rejected (attempt limit reached).
A child that ends without delivering has an unmet obligation — and because a parent is parked on a result that is never coming, typed debt fails the run rather than pretending.
Narrower, never wider
A child's tools can only reduce authority relative to its parent's callable set. Delegation is not a privilege-escalation path (Security).
Steps own their children
A child spawned while a plan step is running belongs to that step, joined by the stable planStepId rather than the label (labels get rewritten between turns). The step row in the UI is the way into the child, and a batch step owns a whole parallel fan-out as uniform peers.
Related
Scripts and the Journal — the other kind of child
Runs — the tree children live in
Do you like what you are reading? Subscribe to receive updates.
Unsubscribe anytime