Goal and prerequisites
The parent first creates a durable paused Session. Its explicit resolver maps the knownnotes_agent descriptor to local subprocess execution. Each child restores a real Session using the installed package; there is no distributed worker service hidden behind this example.
delegate and spawn submit child work; fan_out submits a batch; join waits for the operation IDs under an explicit policy. Inspect four child completions and a closed join. The resolver handles join without rerunning its referenced children. Child final responses are scripted in this bounded scheduler lesson; successful orchestration is not proof of independent model reasoning.
Run handoff.py separately. The destination resumes the same work item in another process, ownership changes, and dispatch from the superseded source is rejected. In contrast, the lifecycle lesson’s fork creates an independent branch and preserves the source head.
Basic Python is required. The package declares Python ≥3.10; local qualification uses Python 3.12.7. Each chapter runs independently; reuse the environment and matching files when continuing your project. Commands below use a macOS/Linux shell.
Prepare the project
Run and verify
--concurrent, which immediately restores/runs the same Session inside the scheduler callable. The source commits transfer admission before dispatch and never writes the head from a late callback. The admission wait returns separately from the destination subprocess result: only the latter proves business completion. Destination restore uses the existing owner/generation CAS. Unknown invocation outcomes are not automatically replayed; the application owns waiting, retries and reconciliation.
Behavior and support boundaries
A timeout or outcome_unknown is terminal for the lesson wait, not a trigger to resubmit work. LocalWorkScheduler is process-local scheduling; durable receipts do not turn it into a distributed queue.Exercise and answer
Inspect the four completion records and distinguish the two individual operations from the two fan-out children. Keep join references as operation IDs, not display names.Common errors and cleanup
ModuleNotFoundError: activate the environment with the specified installation and save every file on this page. Existing run root: choose a new --root instead of overwriting evidence. Assertion failure: inspect the first failed tool or typed error, not only the final text. After all processes and the board stop, remove only this lesson’s newly created run directories if no longer needed; retain SQLite, journals and reports you want to debug.
Complete files: save in the project root
notes.py
agent.yaml
multi_agent.py
handoff.py
