Fork
Every agent task produces a reusable session snapshot. Usefork to start a new task from any previous task’s context.
<Task id={B} fork={A}> means:
Bdepends onAand cannot run untilAhas completed.Bstarts from a copy ofA’s final agent session context, then submits its own prompt into that copy.Bproduces its own output and its own session snapshot.Ais never mutated.
fork is immutable. It does not continue or mutate the source task — it copies the conversation into a fresh, independent session. Multiple tasks may fork the same source safely, and a forked task may itself be forked.
VERIFY forks IMPLEMENT, which forked PLAN, so VERIFY sees the whole plan → implement conversation.
Parallel branches — fork the same source from sibling tasks; each gets its own copy and they never affect each other:
fork composes with dependsOn, needs, deps, Sequence, Parallel, Branch, and Loop. Inside a loop, fork resolves to the latest completed session snapshot for that task id — there is no iteration selector and no ambiguity.
Error cases
TASK_FORK_SOURCE_NOT_FOUND—forkpoints to a task id not present in the graph (including a source that exists only in an unselected<Branch>).TASK_FORK_CYCLE—forkcreates a cycle, directly or indirectly.TASK_FORK_SESSION_UNAVAILABLE— the forking task is not an agent task, or the source completed but produced no usable session snapshot (e.g. a compute/static source, or a source that was skipped/cancelled).TASK_FORK_SOURCE_NOT_COMPLETE— the source exists but has not completed; the forked task waits and does not run.
Notes
- Three modes by
childrenshape: agent (withagent), compute (function, no agent), static (value, no agent). forkrequires an agent task; the source must be an agent task with a session snapshot. Forking copies the conversation into a new session and never reuses a native session id.- When
outputSchemais set, JSON is extracted from agent text; schema-validation retries don’t consumeretries. - Auth errors short-circuit retries; non-idempotent tool reuse warns on the next attempt.