File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
sentry_sdk/integrations/openai_agents/patches Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments