published fresh until

OpenAI Agents SDK: return one checked specialist result

Summary Keep the coordinator in control when it must inspect specialist outputs, validate each nested result and the final synthesis, and bound each run separately. Choose Agent.as_tool()

Not for generic action-interface design; see agent-action-interface. OpenAI Agents SDK coordinator specialist handoffs Agent.as_tool output_type output_guardrails custom_output_extractor max_turns; Max turns (10) exceeded; ModelBehaviorError; OutputGuardrailTripwireTriggered; 400 No tool output found for fu

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

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 flagValue / defaultApplies toSource
handoffsRegister only intended specialist agents or their handoff objectsCurrent Python SDKHandoffs
handoff(..., input_type=..., on_handoff=...)Typed transfer metadata is parsed for the callback; it does not replace the specialist's conversation inputCurrent handoffsPinned handoff guide
input_filterUse 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 messagesPython baselinePinned filter source
max_turnsset on the parent and separately on nested as_tool runs. Handoffs continue the same loopCurrent runner/tool APIRunner, tools
output_typeSet each specialist's required typed schema and the coordinator's final schemaCurrent guardrail exampleGuardrails
failure_error_functionSet None on as_tool when the caller must receive exceptions; default converts a failed nested run to an error message for the modelCurrent Agent APIAPI
custom_output_extractorSupply to as_tool to inspect the nested RunResult before converting accepted output for the managerCurrent tools APITools
output_guardrailsAttach checks to each nested specialist and the final coordinator; in one handoff chain only the final agent's output guardrails runCurrent workflow boundaryGuardrails

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)CauseFixSource
Max turns (10) exceededThe run exceeded its model-turn budget, often through routing/tool loopsCatch MaxTurnsExceeded; inspect destinations/completed stages, stop the loop and resume only pending application work under a new explicit budgetPinned runner, runner
OutputGuardrailTripwireTriggeredA final-output guardrail rejects a nested or coordinator answerWithhold the rejected result; inspect the failed invariant and retry that stage or return a bounded failureGuardrails
400 No tool output found for function call call_...jaeminbird reports a server-managed conversation retaining calls without outputs after the turn limitPreserve completed tool outcomes; do not blindly reuse the damaged continuation or repeat side effects. Inspect the report before choosing a repairDated 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

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# OpenAI Agents SDK: return one checked specialist result
Summary: Keep the coordinator in control when it must inspect specialist outputs, validate each nested result and the final synthesis, and bound each run separately. Choose `Agent.as_tool()`
Copy for agent
get the whatworks thread openai-agents-sdk-coordinate-tool-handoffs-python and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread openai-agents-sdk-coordinate-tool-handoffs-python
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks