Integrating LangFuse with OpenAI Agent SDK drops reasoning summaries? #12876
-
Describe your questionIntegration Pattern
Issue: Reasoning Content Text Not Captured (Primary)What happens: GPT-5.4 with {
"id": "rs_00b3fcaccac6020c...",
"summary": [
{
"text": "I'm thinking about setting the year to null...",
"type": "summary_text"
}
],
"type": "reasoning"
}Our custom session correctly handles these (they're tracked as context-providing messages for summarization decisions). But LangFuse traces do not surface the reasoning text in any structured or visible way. What we need: The reasoning summary text (which OpenAI returns when Reasoning(summary="detailed") is set) should appear in the LangFuse trace UI — either as a dedicated field on the generation observation, a nested span, or at minimum in the observation metadata. This is critical for debugging agent decisions. Langfuse Cloud or Self-Hosted?Langfuse Cloud If Self-HostedNo response If Langfuse CloudSDK and integration versionsStack
Pre-Submission Checklist
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Reasoning summaries from OpenAI models are captured by Langfuse, but there was a known issue with how they were displayed in the platform's "formatted" view. (1) The reasoning summary data does get stored in the observation output. When viewing a generation span in JSON mode, you can see the full reasoning structure including the summary text. (1) The issue was specifically with the "formatted" view rendering—it applied markdown parsing to structured JSON, causing poor readability and bolding artifacts inside JSON blobs. (1) This formatting issue has since been fixed. A user confirmed in the GitHub issue that "it looks like this has been fixed" when checking the cloud platform. (1) To verify your reasoning data is being captured:
If you're not seeing reasoning content at all (even in JSON view), the issue may be with how the OpenAI Agents Instrumentor is serializing the response. Some attributes may be stored in the metadata object rather than being mapped to the Langfuse data model directly. (2) If the mapping or integration doesn't work as expected, you can raise an issue on GitHub. (2) 📚 Sources: Have another question? Just tag @inkeep. |
Beta Was this translation helpful? Give feedback.
Reasoning summaries from OpenAI models are captured by Langfuse, but there was a known issue with how they were displayed in the platform's "formatted" view. (1)
The reasoning summary data does get stored in the observation output. When viewing a generation span in JSON mode, you can see the full reasoning structure including the summary text. (1) The issue was specifically with the "formatted" view rendering—it applied markdown parsing to structured JSON, causing poor readability and bolding artifacts inside JSON blobs. (1)
This formatting issue has since been fixed. A user confirmed in the GitHub issue that "it looks like this has been fixed" when checking the cloud platform. (1)
To ver…