Commit 2872675
authored
fix(openai-agents): Move _set_agent_data call to ai_client_span function (#4876)
### Description
We can set the agent data early, so that we get input model and other
data, even if there's an exception while running the agent
#### Issues
Resolves: TET-1205
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Move `_set_agent_data` to `ai_client_span` so agent/model metadata is
recorded when the span is created.
>
> - **Tracing
(`sentry_sdk/integrations/openai_agents/spans/ai_client.py`)**:
> - Set agent metadata in `ai_client_span` via `_set_agent_data` at span
creation.
> - Remove `_set_agent_data` from `update_ai_client_span` to avoid
duplication.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
27e94cc. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 9b58d31 commit 2872675
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
31 | 33 | | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | | - | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
0 commit comments