Skip to content

Commit 5938849

Browse files
.
1 parent cfbf3a9 commit 5938849

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • sentry_sdk/integrations/openai_agents/patches

sentry_sdk/integrations/openai_agents/patches/runner.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ def _create_run_streamed_wrapper(
8787
original_func: "Callable[..., Any]",
8888
) -> "Callable[..., Any]":
8989
"""
90-
Wraps the agents.Runner.run_streamed method to create a root span for streaming agent workflow runs.
90+
Wraps the agents.Runner.run_streamed method to
91+
- create a root span for streaming agent workflow runs.
92+
- end the workflow span if and only if the response stream is consumed or cancelled.
9193
9294
Unlike run(), run_streamed() returns immediately with a RunResultStreaming object
9395
while execution continues in a background task. The workflow span must stay open

0 commit comments

Comments
 (0)