What this thread does
Do first: use Agent.as_tool() when the coordinator must inspect a specialist's result before returning one final answer (orchestration).
Short answer
As of November 2026 (checked 2026-11-23), the Python release baseline is openai-agents 0.25.0. For a checked aggregate, use manager-owned nested calls or a code-controlled sequence that validates each result before synthesis.
Choose / don't choose
- Handoff: choose when a specialist should own the rest of the conversation; don't use it as if it were a function returning to the router.
- Agent as tool: choose when the manager must combine or inspect specialist results.
- Code-controlled workflow: choose when every required specialist/check must run deterministically; don't rely on a model's optional tool selection to ensure coverage (orchestration).
Not for: generic action-interface design; see agent-action-interface.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
handoffs | Register only intended specialist agents or their handoff objects | Current Python SDK | Handoffs |
handoff(..., input_type=..., on_handoff=...) | Typed transfer metadata is parsed for the callback; it does not replace the specialist's conversation input | Current handoffs | Pinned handoff guide |
input_filter | Use a filter for the history the specialist should see; handoff_filters.remove_all_tools removes structured tool items; it does not redact tool arguments or results already copied into ordinary messages | Python baseline | Pinned filter source |
max_turns | set on the parent and separately on nested as_tool runs. Handoffs continue the same loop | Current runner/tool API | Runner, tools |
output_type | Set each specialist's required typed schema and the coordinator's final schema | Current guardrail example | Guardrails |
failure_error_function | Set None on as_tool when the caller must receive exceptions; default converts a failed nested run to an error message for the model | Current Agent API | API |
custom_output_extractor | Supply to as_tool to inspect the nested RunResult before converting accepted output for the manager | Current tools API | Tools |
output_guardrails | Attach checks to each nested specialist and the final coordinator; in one handoff chain only the final agent's output guardrails run | Current workflow boundary | Guardrails |
Order of operations
1. Define typed specialist outputs, permitted tools and coordinator instructions before the run. Register only the required destinations. If using handoffs, validate metadata in the callback and filter history; the transfer destination is fixed by the registered edge (handoffs). 2. Bound the parent and every nested run. A loop iteration invokes a model; a handoff updates the current agent and input, and re-runs the loop. Nested agent-as-tool runs support max_turns (tools). 3. Application policy: persist accepted specialist outcomes with stable job identities before synthesis. Validate schema plus domain invariants at each nested-result boundary, and fail closed before forwarding an invalid outcome. Inspect RunResult.final_output in code or in the custom extractor; a coordinator-only output guardrail does not cover every intermediate specialist (results, guardrail boundaries). 4. Synthesize only accepted outcomes, then validate the coordinator's final result before delivery. Do not expose streamed partial text as the checked final answer. On failure, retry only the rejected stage using retained accepted results; side-effecting tools need application idempotency, not a full blind restart.
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
Max turns (10) exceeded | The run exceeded its model-turn budget, often through routing/tool loops | Catch MaxTurnsExceeded; inspect destinations/completed stages, stop the loop and resume only pending application work under a new explicit budget | Pinned runner, runner |
OutputGuardrailTripwireTriggered | A final-output guardrail rejects a nested or coordinator answer | Withhold the rejected result; inspect the failed invariant and retry that stage or return a bounded failure | Guardrails |
400 No tool output found for function call call_... | jaeminbird reports a server-managed conversation retaining calls without outputs after the turn limit | Preserve completed tool outcomes; do not blindly reuse the damaged continuation or repeat side effects. Inspect the report before choosing a repair | Dated report #5642 |
With failure_error_function=None, nested exceptions propagate for application handling; with the default formatter, do not accept its error text as a successful specialist outcome (Agent API). In #1712, goooodle's historical missing-handoff-event report concerned filtering/streaming. Inspect final-agent identity and accepted result state as well as UI events.
Missing
- The linked source does not confirm: A handoff transfers conversational control; it does not automatically return to the coordinator for review.
- The linked source does not confirm: don't assume the parent's turn limit bounds nested runs (tools).
- The linked source does not confirm: omitted destinations are unavailable to this coordinator
- The linked source does not confirm: shape validation is not a business-rule check
- The linked source does not confirm: Several handoffs do not grant fresh parent budgets (runner).
- The linked source does not confirm: An invalid structured final response can instead raise
ModelBehaviorError(runner); catch it at the specialist boundary. - No universal safe turn count or durable recovery guarantee follows from the SDK. The checkpoint/idempotency policy above belongs to the application.
- The server-conversation report does not establish a released repair version. A handoff-only router does not satisfy coordinator review unless an explicit return/check stage is added.
Checked
2026-11-12; release, orchestration/handoff/tools/runner/results/guardrail references, pinned handoff/filter/runner source and dated reports by goooodle and jaeminbird read. No agents or provider requests executed.
Started from a post by @OpenAI, packaged by the editor. Original post