Quick Start
1
See the blocking limitation
delegate_task runs the child synchronously. If that child reaches a HITL approval pause, the parent turn hangs — there is no durable handle to resume it.2
Use the non-blocking workaround
Spawn the child in the background so the parent stays responsive, then collect the completed output with
wait=True.subagent_result defaults to wait=False, returning a {"status": "running", ...} handle if the job is unfinished. Pass wait=True (or poll until status is terminal) to collect the output. This avoids blocking the parent turn but is not a HITL resume flow.How It Works
A HITL approval pause inside a delegated child has no path back to the parent turn, so the parent blocks on the child’schat() call until the timeout fires.
Convert the behaviour into what it means for you:
Which option should I pick?
Pick the delegation style by whether the child needs HITL approval and whether it may block.Missing pieces for resumable delegation
The following pieces are required before delegated children can be considered resumable:- Durable child session persistence through the session store.
- A child-run result-state contract, for example
pending,completed,failed, andhalted. - HITL bubble-up from child to parent, so an approval pause creates a durable pending handle.
- A
drive_childor equivalent continuation seam to resume the paused child. - Ownership and lifecycle rules for cancellation, timeouts, and result collection.
v0 child-run pause/resume contract before designing the full gateway UX. The first contract should be explicitly internal and anti-freeze — keep the resume handle opaque so later metadata (approval IDs, gateway routing, cancellation state) can be added without changing the parent-facing shape.
Proposed v0 state shape
Proposed v0 state shape (for maintainers)
Proposed v0 state shape (for maintainers)
A possible Semantics:
v0 state shape for the internal child-run contract:pending: the child reached a HITL approval pause; the parent should receive a durable handle rather than block indefinitely.pause_reasonis set (e.g.approval_required) andresume_tokenis non-null so the parent can continue the child.resultanderrorare null.completed: the child reached a terminal success state; the parent can collect the output fromresult.pause_reason,resume_token, anderrorare null.failed: the child reached a terminal failure state; failure details are available inerror.pause_reason,resume_token, andresultare null.halted: the child was cancelled or stopped in a non-resumable way that is not a normal success/failure (e.g. timeout or explicit cancellation).pause_reasonandresume_tokenare null.
completed (success) from failed (failure) lets consumers classify terminal outcomes consistently and know exactly where to read the result or the failure reason.Best Practices
Do not use delegate_task for approval-heavy child flows
Do not use delegate_task for approval-heavy child flows
Nested
@require_approval tools inside a delegated child do not bubble their approval prompt to the parent turn today — the parent hangs or fails opaquely. Keep approval-gated work out of synchronous delegation.Prefer spawn_subagent(background=True) for anything that may block
Prefer spawn_subagent(background=True) for anything that may block
Run potentially blocking work in the background and pass
wait=True to subagent_result(job_id) to collect the completed output. Poll with wait=False if you need to stay responsive between checks.Do not assume child state survives a process restart
Do not assume child state survives a process restart
Delegated child sessions are not persisted through the session store today, so a daemon restart mid-child loses that work. Treat delegated results as ephemeral until resumable delegation ships.
When you need HITL, prefer handoffs
When you need HITL, prefer handoffs
Route the user directly to the specialist with
Agent(..., handoffs=[specialist]) so approvals happen in the user’s live turn, not in a blocked worker thread.Related
Delegate Task
Sub-agent delegation from a parent agent.
Named Agent Delegation
Delegate to specific named agents.
Approval
Human-in-the-loop approval framework.
Run-State Journal
Durable per-event cursor for run resume — the primitive that would unblock Missing Piece #1.

