A transfer target is an agent to which the current agent may hand over control. The target inherits the shared conversation context, completes the task, and leaves the result for the calling agent’s execution flow. section 9.5.3 section 9.5.5
Targets come from an agent tree rather than an unrestricted global list. An agent can transfer to its children, its parent, and—unless peer transfers are disabled—its siblings.
Define a reliable target set by enforcing these constraints:
- Give every agent a unique name within the tree; transfer requests resolve targets by name. section 9.5.3
- Describe each specialist so the current agent can select an appropriate destination. section 9.5.3
Router with specialist targets
A router manages math and search specialists. The router can transfer to either child; the math agent can transfer back to the router or across to search. Setting disallow_transfer_to_peers=True on math leaves only the router as its target.
At runtime, the agent registers a transfer tool for its targets, exposes that tool to the LLM, executes the selected call, and records the target name in execution context. The run loop resolves the name, invokes the target with the existing context, then exits the current agent’s loop. section 9.5.5
