File tree Expand file tree Collapse file tree
sentry_sdk/integrations/openai_agents/patches Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ async def _run_single_turn(
114114 return await original_run_single_turn (* args , ** kwargs )
115115
116116 try :
117- return await original_run_single_turn (* args , ** kwargs )
117+ result = await original_run_single_turn (* args , ** kwargs )
118118 except Exception :
119119 exc_info = sys .exc_info ()
120120 with capture_internal_exceptions ():
@@ -124,6 +124,8 @@ async def _run_single_turn(
124124 delattr (context_wrapper , "_sentry_agent_span" )
125125 reraise (* exc_info )
126126
127+ return result
128+
127129
128130async def _run_single_turn_streamed (
129131 original_run_single_turn_streamed : "Callable[..., Awaitable[SingleStepResult]]" ,
@@ -193,13 +195,15 @@ async def _run_single_turn_streamed(
193195 agent = agent ,
194196 ):
195197 try :
196- return await original_run_single_turn_streamed (* args , ** kwargs )
198+ result = await original_run_single_turn_streamed (* args , ** kwargs )
197199 except Exception :
198200 exc_info = sys .exc_info ()
199201 with capture_internal_exceptions ():
200202 _close_streaming_workflow_span (agent )
201203 reraise (* exc_info )
202204
205+ return result
206+
203207
204208async def _execute_handoffs (
205209 original_execute_handoffs : "Callable[..., SingleStepResult]" ,
You can’t perform that action at this time.
0 commit comments