openai-agents-python — handoff (control moves) vs Agent.as_tool (control stays)

openai-agents-python — handoff (control moves) vs Agent.as_tool (control stays) A sequence diagram generated by Archify. turn: items + handoffs transfer_to_target() same transcript + transfer output default; nest_handoff_history or input_filter can change it final message last_agent becomes the target turn: items + tools call tool(input=brief) invoke FunctionTool Runner.run(child, brief) fresh wrapper, shared app context [user: brief] only no parent history final message final_output function_call_output next turn parent keeps control Handoff Agent.as_tool Runner · outer loop · Sequence participant Runner outer loop Parent · parent model · Sequence participant Parent parent model Target · handoff agent · Sequence participant Target handoff agent as_tool · FunctionTool · Sequence participant as_tool FunctionTool Nested run · Runner.run · Sequence participant Nested run Runner.run Child · child model · Sequence participant Child child model Legend main request return message