openai-agents-python — one Runner.run, two turns, end to end

openai-agents-python — one Runner.run, two turns, end to end A sequence diagram generated by Archify. Runner.run(agent, input, session) get_items(limit) → history history prepended; new input saved before turn 1 run_single_turn() turn 1 also starts input guardrails get_response(system, items, tools, handoffs) call_model_input_filter runs just before ModelResponse(items) adapter converts the provider reply into items process_model_response message · function_call · handoff · hosted invoke tool calls approval check, tool guardrails, concurrent outputs or error text NextStepRunAgain runner then appends the turn items to the session run_single_turn() input = original + generated items get_response(...) message, no tool calls process_model_response NextStepFinalOutput output guardrails and final save follow RunResult(final_output) Prepare Turn 1: model Turn 1: tools Turn 2 Finish App · caller · Sequence participant App caller AgentRunner · _run_impl loop · Sequence participant AgentRunner _run_impl loop Session · history store · Sequence participant Session history store Turn · run_single_turn · Sequence participant Turn run_single_turn Model · adapter → LLM API · Sequence participant Model adapter → LLM API Resolver · turn_resolution · Sequence participant Resolver turn_resolution Tools · local execution · Sequence participant Tools local execution Legend main request return message