handoff moves the conversation to another agent from inside an operation tree. Use it when the tree decides where the conversation goes — after a lookup, inside an if. When the model should pick a destination from what the caller asks for, use the agent’s handoffs field instead. To reach a person, use transfer.

Config

Set exactly one of target_agent_id and agent_name; neither or both is refused at save.

summary is text, not a request

The tree runs after the model’s tool call, so there is no second model call to write a summary. summary resolves like any template, and what it resolves to is what the target receives:
  • {{args.summary}} — declare a summary property on this tool’s json_schema and describe what to put in it; the model writes it when it calls the tool.
  • {{tooldata.brief}} — something an earlier operation published.
  • Fixed prose, optionally with tokens.
If it resolves to empty on a call, the handoff still happens and the target gets only the recent turns.

What is checked when

At run time

  • message is queued before the target is built and always plays to the end before the target speaks. The target then runs its on_enter hook, then speaks its greeting, or opens from instructions and its prompt if it has none.
  • handoff is terminal: nothing may follow it in its chain.
  • A call allows 25 handoffs in total, counting both handoffs and this operation. Past that, the agent tells the caller it cannot pass them on again.
  • In a test run the handoff is simulated: the step reports the resolved target, context, summary and message, the run returns handed_off: true, and the target is never loaded.

Next

Handoffs

Routing by tree, from the team’s side.

Context policies

What transcript, summary and none carry.