From c16daa0e6de9ad4dee75cff0fe73d424e5ba172d Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 7 Sep 2026 13:40:39 +0200 Subject: [PATCH] fix(openai-agents): Use isinstance to determine tool type --- sentry_sdk/integrations/openai_agents/patches/tools.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sentry_sdk/integrations/openai_agents/patches/tools.py b/sentry_sdk/integrations/openai_agents/patches/tools.py index 8ba398a27e..2ddf7e7592 100644 --- a/sentry_sdk/integrations/openai_agents/patches/tools.py +++ b/sentry_sdk/integrations/openai_agents/patches/tools.py @@ -15,6 +15,7 @@ try: import agents + from agents import FunctionTool except ImportError: raise DidNotEnable("OpenAI Agents not installed") @@ -33,7 +34,7 @@ async def _get_all_tools( wrapped_tools = [] for tool in tools: # Wrap only the function tools (for now) - if tool.__class__.__name__ != "FunctionTool": + if not isinstance(tool, FunctionTool): wrapped_tools.append(tool) continue