Skip to content

AttributeError: 'Handoff' object has no attribute 'name' #1897

@tnduyh5

Description

@tnduyh5

Hi team -> can you help me verify this bugs. I'm using this sdk have see the error Handoff' object has no attribute 'name' -> Then I use AI to help debug, please review below

Handoff.name Bug Fix

Issue

The application was experiencing an AttributeError when using agent handoffs:

AttributeError: 'Handoff' object has no attribute 'name'

This error occurred at runtime when the OpenAI Agents SDK tried to list tool names in agents/run.py line 903:

tool_names = [t.name for t in all_tools]

Root Cause

The issue is in the openai-agents SDK v0.3.3:

  1. The Handoff class has a tool_name attribute
  2. The FunctionTool class has a name attribute
  3. The SDK's run.py tries to access .name on all tools (including handoffs)
  4. Since Handoff doesn't have .name, it raises an AttributeError

Debug information

  • Agents SDK version: v0.3.3
  • Python version:3.11

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:coreneeds-more-infoWaiting for a reply/more info from the authorquestionQuestion about using the SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions