← GUIDES

GUIDE / SETUP NOTE

AI Agent Orchestration: Handoffs vs a Manager Agent

Handoffs vs a manager agent in the OpenAI Agents SDK on a local model, with a person approving refunds. What each did when the person said no.

28 Nov 2026Checked 2026-10-30
Four runs where a person said no to a refund, handoff and manager: both setups asked again, and in runs 3 and 4 the final answer spoke of a refund when nothing was refunded

OpenAI Agents SDK 0.24.0 docs on multi-agent orchestration, handoffs and human-in-the-loop, read on 2026-10-30, plus ten runs of a two-agent refund setup on qwen2.5:3b through a local Ollama 0.40.13 server. No OpenAI key; tracing turned off.

The OpenAI Agents SDK offers two ways to split work between agents: a handoff, where a specialist takes over the conversation, and a manager that calls specialists as tools and keeps the last word. We built both around a refund that needs a person's yes, ran them on a local model, and said yes and no. Approval worked in both. What the agents did after a no is the part to plan for.

A person approves every refund after seeing the order and the amount. The SDK pauses the whole run until they answer.

Based on the OpenAI Agents SDK, by OpenAI and contributors. MIT licence per GitHub on 2026-10-30.

The two patterns (checked 2026-10-30)

The SDK's multi-agent page puts it this way:

  • Agents as tools: "A manager agent keeps control of the conversation and calls specialist agents through Agent.as_tool()." Use it when "a specialist should help with a bounded subtask but should not take over the user-facing conversation."
  • Handoffs: "A triage agent routes the conversation to a specialist, and that specialist becomes the active agent for the rest of the turn." The handoffs page adds that handoffs "are represented as tools to the LLM", named like transfer_to_refund_agent.

The human-in-the-loop page says approval works across both: a tool marked needs_approval=True pauses the run "when the tool belongs to the current agent, to an agent reached through a handoff, or to a nested Agent.as_tool() execution." Pending calls appear in result.interruptions. You call state.approve(...) or state.reject(...) on result.to_state() and run again from the top-level agent.

The setup

One Refunds agent with two tools, lookup_order and issue_refund, and the refund marked needs_approval=True. The order is fake: 1042, a desk lamp, total 59.9. The refund tool appends to a list instead of moving money.

python
M = OpenAIChatCompletionsModel(model="qwen2.5:3b",
        openai_client=AsyncOpenAI(base_url="http://127.0.0.1:11434/v1", api_key="ollama"))
set_tracing_disabled(True)

@function_tool(needs_approval=True)
def issue_refund(order_id: str, amount: float) -> str:
    """Refund money on an order."""
    return common.refund(order_id, amount)

refunds = Agent(name="Refunds", model=M, instructions="Look up the order, then refund its total.",
                tools=[lookup_order, issue_refund])
# Pattern 1: handoff
top = Agent(name="Front desk", model=M, instructions="Hand refund requests to Refunds.", handoffs=[refunds])
# Pattern 2: manager
top = Agent(name="Manager", model=M, instructions="Use the refunds tool for refund requests, then tell the customer the result.",
            tools=[refunds.as_tool(tool_name="refunds", tool_description="Handles a refund request end to end.")])

r = await Runner.run(top, TASK, max_turns=8)
while r.interruptions:
    st = r.to_state()
    for it in r.interruptions:
        a = json.loads(it.arguments)
        st.approve(it) if ask(a["order_id"], a["amount"]) else st.reject(it)
    r = await Runner.run(top, st)

The qwen2.5:3b weights are under the "Qwen RESEARCH LICENSE AGREEMENT", for non-commercial use only; check the model card before any commercial use.

The api_key string is a placeholder Ollama ignores. The SDK's models page suggests set_tracing_disabled() when you have no OpenAI key, so traces are not sent anywhere.

What happened in ten runs

RunPatternPerson's answersWhat happened
1HandoffyesPaused with agent=Refunds tool=issue_refund args={"order_id":"1042","amount":59.9}. Refunded 59.9. Refunds gave the final answer
2ManageryesSame pause, same arguments. Refunded 59.9. Manager gave the final answer, calling it "Order 102"
3Handoffno; the trimmed output shows only the last answer, which was no inputThe trimmed output shows one request at 59.9. Final: "it seems the full amount of $59.90 should be automatically refunded after a few moments." Nothing refunded
4Managerno, then no inputAsked twice. Final: "The total amount of $59.90 has been refunded to your account." Nothing was refunded
5Handoffno, no, no, then no input twiceAsked four times at 59.9, then once at 10
6Managerno, no, noAsked at 50, then 59.9 twice. Final: "the system is still unable to process the refund request... Let's try again momentarily." Nothing refunded
7 to 10Bothno, with a rejection messageSee below

Run 5 stopped with MaxTurnsExceeded: Max turns (8) exceeded, and nothing was refunded. Its last two answers were empty input, which our script counts as no; they were not typed nos.

Our script counts a missing answer as no.

The fix we tested: a rejection message

The docs say a rejected call sends the SDK's standard rejection text back into the run by default, and that passing rejection_message=... to state.reject(...) makes that one call surface a different message to the model. We passed: "The person refused this refund. Do not retry. Tell the customer no refund was made."

  • Handoff, twice: one request each, no retry. Both answers said no refund was made, though one blamed "the customer" for refusing.
  • Manager, twice: once the manager never called the tool and asked the user to confirm instead. Once it proposed 100, we said no, and it said the refund "could not be issued".

That is four runs with no retry loop, against a retry in every no run without the message whose output shows more than one request (runs 4, 5 and 6). It is a small sample on a 3B model.

Handoffs vs a manager, from this test

  • Who talks to the customer. With a handoff, the specialist answered. With a manager, the manager answered and retold what happened. In run 4 the manager told the customer about a refund that never happened, and in run 3 the specialist was just as misleading, so neither pattern makes the summary trustworthy.
  • Approval is the same. In both patterns the pending refund showed up in the outer run's interruptions, with the same agent, tool and arguments, so one approval loop covered both. A later re-run printed its type as ToolApprovalItem in the handoff pattern; the manager pattern did not call the refund tool in 11 re-runs, so its type was not printed.
  • Rejection needs words. Without a message, the agents treated a no as a temporary error and tried again, once with a lower amount.
  • Caps matter. max_turns=8 is what ended run 5.

What we would do

  • Use handoffs when the specialist should own the reply; use a manager when you need one voice or need to combine several specialists.
  • Always pass a rejection_message that says do not retry.
  • Do not send the final answer straight to a customer. Check your refund records first; the model's summary was wrong in runs 3 and 4.

Takeaway

In AI agent orchestration, the choice between handoffs and a manager decides who speaks last. Approval worked in both. Give rejections a clear message, cap the turns, and check the record before you trust the summary.

Next step: add needs_approval=True to your riskiest tool, say no once, and read what your agents do next.

How we check the tools we list is on our verification page.

Good setups, worth keeping. Request email updates on the home page, then confirm by email. No subscription starts until you confirm. Or find an agent for the job.

Your privacy choices

Choose optional tools. Rejecting them keeps the setup library available. Advertising consent stays off.

Choices stay in this browser for 90 days. You can change them using Privacy settings. Privacy and cookie details