Skip to content

fix(openai-agents): emit message content and reasoning for LLM spans#2886

Open
syedmohsinbukhari-chaos wants to merge 2 commits intoArize-ai:mainfrom
syedmohsinbukhari-chaos:fix-openai-agents-span
Open

fix(openai-agents): emit message content and reasoning for LLM spans#2886
syedmohsinbukhari-chaos wants to merge 2 commits intoArize-ai:mainfrom
syedmohsinbukhari-chaos:fix-openai-agents-span

Conversation

@syedmohsinbukhari-chaos
Copy link
Copy Markdown

Fixes #2882

Summary

  • LLM span output message content: _get_attributes_from_message now emits a flat message.content string (text parts joined with newlines) in addition to the structured message.contents items. This makes output content accessible to downstream consumers like LangWatch that expect message.content.
  • Reasoning items no longer dropped: _get_attributes_from_response_output now handles ResponseReasoningItem output items, emitting the reasoning summary as an assistant message with message.content instead of silently discarding them.

Tests

Updated test_span_attribute_helpers.py to cover both changes, including a new reasoning_output test case for _get_attributes_from_response_output.

@syedmohsinbukhari-chaos syedmohsinbukhari-chaos requested a review from a team as a code owner March 12, 2026 18:59
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Mar 12, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 12, 2026

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@syedmohsinbukhari-chaos
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

Signed-off-by: Syed Mohsin Bukhari <syed.mohsin-bukhari@chaos.com>
…ning test

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

[bug][openai-agents] LLM span GENERATED section shows {"role": "assistant"} with no content

1 participant