Handoffs
Notebook· 09.03· 120–150 min· Lesson 74 of 129
The notebook opens in your lab, in a new tab. If your server is stopped, it starts first (a few seconds).
By the end you can
- Build state-driven handoffs in one agent: middleware swaps the system prompt and tools based on
current_step(the form the docs recommend). - Build handoffs between agent subgraphs:
Command(goto=..., graph=Command.PARENT)and anactive_agentkey (triage → billing → technical). - Explain why the next turn skips triage, and measure what that saves vs subagents.
- Debug the classic handoff bug: lost context and agents handing back and forth until the recursion limit.
- Keep human approval working inside a handoff (refunds over $50).
Before you start
Lesson 09.02; Module 04 (@wrap_model_call); Module 07 (Command).
