Skip to content

Commit 5f73e4f

Browse files
committed
fix: mypy lint issues
1 parent 5e0d558 commit 5f73e4f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sentry_sdk/integrations/openai_agents/patches/agent_run.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ async def patched_run_single_turn(
9090
"""Patched _run_single_turn that creates agent invocation spans"""
9191
agent = kwargs.get("agent")
9292
context_wrapper = kwargs.get("context_wrapper")
93-
should_run_agent_start_hooks = kwargs.get("should_run_agent_start_hooks")
93+
should_run_agent_start_hooks = kwargs.get("should_run_agent_start_hooks", False)
9494

9595
span = _maybe_start_agent_span(
9696
context_wrapper, agent, should_run_agent_start_hooks, kwargs
@@ -196,8 +196,10 @@ async def patched_run_single_turn_streamed(
196196
streamed_result = args[0] if len(args) > 0 else kwargs.get("streamed_result")
197197
agent = args[1] if len(args) > 1 else kwargs.get("agent")
198198
context_wrapper = args[3] if len(args) > 3 else kwargs.get("context_wrapper")
199-
should_run_agent_start_hooks = (
200-
args[5] if len(args) > 5 else kwargs.get("should_run_agent_start_hooks")
199+
should_run_agent_start_hooks = bool(
200+
args[5]
201+
if len(args) > 5
202+
else kwargs.get("should_run_agent_start_hooks", False)
201203
)
202204

203205
# Build span kwargs with original_input from streamed_result for request messages

0 commit comments

Comments
 (0)