Skip to content

openai_agents integration crashes with openai-agents==0.8.0 (AgentRunner has no _get_all_tools) #5429

@samiashi

Description

@samiashi

How do you use Sentry?

Sentry Saas (sentry.io)

Version

2.52.0

Steps to Reproduce

  1. Install sentry-sdk==2.52.0 and openai-agents==0.8.0.
  2. Initialize Sentry with default integrations enabled.
  3. Start Django app (or run python manage.py check with Sentry init in settings).

Expected Result

App starts successfully and Sentry initializes.

Actual Result

Application crashes during startup while sentry_sdk.init(...) runs and sets up integrations.
The failure occurs in sentry_sdk.integrations.openai_agents._patch_tools, where Sentry tries to patch agents.run.AgentRunner._get_all_tools, but that attribute does not exist with openai-agents==0.8.0.

Traceback (most recent call last):
  ...
  File "/usr/local/lib/python3.12/site-packages/sentry_sdk/integrations/openai_agents/__init__.py", line 50, in _patch_tools
    _create_get_all_tools_wrapper(agents.run.AgentRunner._get_all_tools),
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: type object 'AgentRunner' has no attribute '_get_all_tools'

Startup aborts before Django initialization completes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions