Commit 996f935
authored
Store the agent invocation span on the `openai-agents` run context, and finish the span by accessing the span on the run context instead of calling `sentry_sdk.get_current_span()`.
Prevents an unhandled exception when using both `OpenAIAgentsIntegration` and `AsyncioIntegration`. The exception is caused by double exit when a span already managed by a with block is unexpectedly returned by `sentry_sdk.get_current_span()`.
Closes #5067
1 parent 9aa4385 commit 996f935
File tree
2 files changed
+4
-2
lines changed- sentry_sdk/integrations/openai_agents
- patches
- spans
2 files changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
0 commit comments