Skip to content

Handoff to agent that uses websearch tool call fails. But works fine if agent is called as a tool #972

Open
@adiberk

Description

@adiberk

Describe the bug

I am successfully able to call agents as tools and ultimately call an agent that uses the WebSearch tool just fine. However the minute I change that agent to be a handoff. I see a strange error

Error code: 400 - 
{'error': {'message': "Invalid 'input[1].id': '__fake_id__'. Expected an ID that begins with 'msg'.", 'type': 'invalid_request_error', 'param': 'input[1].id', 'code': 'invalid_value'}}

I included a picture of the logfire traces to show how in the first scenario with an error it is using a handoff. In the second it is using an agent as a tool

I also included how the websearch tool is definitely working and you can see it being called internally in the second picture. So i am left unsure why it would work fine in an agent as tool call but not in a handoff

Debug information

  • Agents SDK version: 0.0.19
  • Python version: 3.11.5

Repro steps

Hard for me to give you a python script for this. But the example was the following
Create a parent orchestrator
Create a child orchestrator with a function call to WebSearch
Parent Orchestrator uses claude
Child Orchestrator uses gpt4.1

First try assigning child orchestrator as a tool

Then try assigning it as a handoff in the parent

You ca n see

Expected behavior

A clear and concise description of what you expected to happen.

Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions