Skip to content

Comments

ref(openai): Remove set_data_normalized for primitive attributes#5513

Draft
alexander-alderman-webb wants to merge 1 commit intomasterfrom
webb/openai/remove-set-data-normalized
Draft

ref(openai): Remove set_data_normalized for primitive attributes#5513
alexander-alderman-webb wants to merge 1 commit intomasterfrom
webb/openai/remove-set-data-normalized

Conversation

@alexander-alderman-webb
Copy link
Contributor

@alexander-alderman-webb alexander-alderman-webb commented Feb 23, 2026

Description

Remove set_data_normalized() for attributes that do not require normalization.

Move setting gen_ai.operation_name to the top level of patches for top-level functions, as the attribute was previously set in all code paths.

Issues

Reminders

@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review February 23, 2026 15:25
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner February 23, 2026 15:25
@github-actions
Copy link
Contributor

github-actions bot commented Feb 23, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Bug Fixes 🐛

Openai

  • Avoid consuming iterables passed to the Completions API by alexander-alderman-webb in #5489
  • Avoid consuming iterables passed to the Embeddings API by alexander-alderman-webb in #5491

Other

  • (anthropic) Fix token accounting by shellmayr in #5490
  • (google-genai) Remove agent spans for simple requests by alexander-alderman-webb in #5443

Documentation 📚

  • New integration guide by alexander-alderman-webb in #5476

Internal Changes 🔧

  • (agents) Add sentry skills to be used by warden in CI reviews by ericapisani in #5485
  • (ai) Add configuration for dotagents by ericapisani in #5480
  • (github) Add warden configuration by ericapisani in #5484
  • (openai) Remove set_data_normalized for primitive attributes by alexander-alderman-webb in #5513
  • (openai-agents) Expect new tool fields by alexander-alderman-webb in #5471
  • (repo) Add .serena to .gitignore by ericapisani in #5464
  • 🤖 Update test matrix with new releases (02/19) by github-actions in #5483
  • 🤖 Update test matrix with new releases (02/18) by github-actions in #5475

🤖 This preview updates automatically when you update the PR.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.


if value is not None and _is_given(value):
set_data_normalized(span, attribute, value)
span.set_data(attribute, value)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Model parameter enum not normalized to string

Medium Severity

The model parameter from kwargs can be a ChatModel enum according to the OpenAI SDK type hints (Union[str, ChatModel]), but it's now passed directly to span.set_data without normalization. This causes enums to be serialized via repr() (producing output like "<ChatModel.GPT_4O: 'gpt-4o'>") instead of being normalized to their string value. The previous set_data_normalized call handled this correctly by converting non-primitive types to strings.

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks I'll handle this case.

@alexander-alderman-webb alexander-alderman-webb marked this pull request as draft February 23, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant