Hierarchical dispatch
Workflows run through three agent layers — meta orchestrator, workflow orchestrator, and activity workers — kept apart by what they must not share: user conversation, workflow state, and task context.
Layer key: L0 = user-facing meta orchestrator · L1 = workflow orchestrator (state owner) · L2 = activity worker (task executor).
Canonical source: docs/dispatch_model.md.
session_index; dispatching a worker (L1 → L2) shares the orchestrator's index, so both read the same canonical session.json on the server. All layers talk to the same server.Responsibilities per layer
| Layer | Lifetime | Key tools | Never does |
|---|---|---|---|
| L0 Meta orchestrator | the conversation | discover, list_workflows, start_session, present_checkpoint, respond_checkpoint, get_workflow_status | domain work; detailed state tracking |
| L1 Workflow orchestrator | one workflow run | get_workflow, next_activity, get_workflow_status, dispatch_child | prompting the user directly |
| L2 Activity worker | one activity | get_activity, get_technique, get_resource, yield_checkpoint, resume_checkpoint | choosing the next activity |
Dispatch mechanics
Each session is identified by a 6-character base32 session_index, deterministically derived from the planning-folder slug. Agents pass the index — never a token — on every authenticated call; the canonical state lives in the server-owned session.json.
The two hand-offs differ in one important way. Starting a workflow (L0 → L1) creates a child session: the server snapshots the parent's session under the child's parentSession field for trace correlation, and the child gets its own index. Spawning a worker (L1 → L2) shares the session: the worker uses the orchestrator's index directly, so both agents see a single canonical state. Fresh workers per activity keep task context disposable; embedded child sessions keep the whole work package in one resumable session.json despite the layering. The actual spawning uses whatever sub-agent mechanism the host provides (Cursor's Task tool, for example); paused sub-agents are woken with the host's resume primitive.
The meta orchestrator can poll a dispatched workflow with get_workflow_status: blocked when a checkpoint is active, completed when no activities remain, active otherwise.
Inline fallback
Hosts without background sub-agents run the same model inline: a single agent adopts each persona in turn within one conversation. The server's enforcement — checkpoint gates, manifests, traces — works identically; only the persona-switching mechanism changes. Portability across MCP clients mattered more than mandating a particular execution topology.
Related
Checkpoints bubble up through these same layers — see the checkpoint model. Session state and the session.json file are covered in state management.