Skip to content

ref(openai-agents): Remove error attributes

f111fad
Select commit
Loading
Failed to load commit list.
Merged

ref(openai-agents): Remove error attributes #5986

ref(openai-agents): Remove error attributes
f111fad
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: code-review completed Apr 13, 2026 in 2m 5s

1 issue

code-review: Found 1 issue (1 high)

High

set_span_errored called with wrong number of arguments causing TypeError at runtime - `sentry_sdk/integrations/openai_agents/patches/agent_run.py:11`

The import changed from _record_exception_on_span to set_span_errored, but set_span_errored in tracing_utils.py only accepts one optional parameter (span). However, line 160 in this file calls set_span_errored(span, exc) with two arguments. This will cause a TypeError: set_span_errored() takes at most 1 argument (2 given) when an exception is raised in _run_single_turn_streamed.

Also found at:

  • sentry_sdk/integrations/openai_agents/patches/agent_run.py:160

Duration: 2m 4s · Tokens: 1.2M in / 13.0k out · Cost: $2.21 (+extraction: $0.00, +merge: $0.00)

Annotations

Check failure on line 11 in sentry_sdk/integrations/openai_agents/patches/agent_run.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: code-review

set_span_errored called with wrong number of arguments causing TypeError at runtime

The import changed from `_record_exception_on_span` to `set_span_errored`, but `set_span_errored` in `tracing_utils.py` only accepts one optional parameter (`span`). However, line 160 in this file calls `set_span_errored(span, exc)` with two arguments. This will cause a `TypeError: set_span_errored() takes at most 1 argument (2 given)` when an exception is raised in `_run_single_turn_streamed`.

Check failure on line 160 in sentry_sdk/integrations/openai_agents/patches/agent_run.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: code-review

[CVU-UDU] set_span_errored called with wrong number of arguments causing TypeError at runtime (additional location)

The import changed from `_record_exception_on_span` to `set_span_errored`, but `set_span_errored` in `tracing_utils.py` only accepts one optional parameter (`span`). However, line 160 in this file calls `set_span_errored(span, exc)` with two arguments. This will cause a `TypeError: set_span_errored() takes at most 1 argument (2 given)` when an exception is raised in `_run_single_turn_streamed`.