Skip to content

Commit 4ca61e6

Browse files
be defensive when accessing the agent span
1 parent 9f2c047 commit 4ca61e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sentry_sdk/integrations/openai_agents/spans/invoke_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def invoke_agent_span(context, agent, kwargs):
7575

7676
def update_invoke_agent_span(context, agent, output):
7777
# type: (agents.RunContextWrapper, agents.Agent, Any) -> None
78-
span = context._sentry_agent_span
78+
span = getattr(context, "_sentry_agent_span", None)
7979

8080
if span:
8181
if should_send_default_pii():

0 commit comments

Comments
 (0)