Skip to content

Exempting handoffs from parallel_tool_calls #1122

@ntbuduma

Description

@ntbuduma

Please read this first

  • Have you read the docs? Yes
  • Have you searched for related issues? Others may have faced similar issues. Yes

Problem

Handoffs are currently implemented as tools, which (afaik) subject them to tool-level configs. One of these configs is parallel_tool_calls, which allows for multiple tool calls to be generated in a single turn. When enabled, multiple handoffs can also be generated in a single turn. However, by definition, handoffs are serial, so the SDK currently deals with this by rejecting all but the first generated handoff with a custom string: "Multiple handoffs detected, ignoring this one."

Empirically, I've noticed that keeping references to SDK-rejected handoffs in the conversation history leads to handoff performance degradation. Agents end up being deterred from handing off to the agents that were SDK-rejected in prior turns, though the rejection was not a reflection of the quality of the handoff or any user intent. I've also verified that removing references to SDK-rejected handoffs addresses the issue.

Suggested Fix

Ask: Instead of rejecting handoffs post-generation, can we exempt handoffs from parallel_tool_calls so they aren't generated in the first place?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions