Skip to content

fix: map streamed reasoning item content - #13079

Open
Amazinghorseli wants to merge 2 commits into
deepset-ai:mainfrom
Amazinghorseli:fix-streaming-reasoning-content
Open

Amazinghorseli wants to merge 2 commits into
deepset-ai:mainfrom
Amazinghorseli:fix-streaming-reasoning-content

Conversation

@Amazinghorseli

Copy link
Copy Markdown

Related Issues

Proposed Changes

Map reasoning_text content from a completed Responses API reasoning item into the Haystack reasoning text field when streaming. If a text delta has already been emitted for that output item, keep the streamed text and avoid appending it a second time. Preserve the full provider payload, including encrypted content, in ReasoningContent.extra.

Add conversion regression coverage for multiple text entries, existing streamed text, another output index, and empty or missing content. Update the component docs and release note.

How did you test it?

  • pytest test/components/generators/chat/test_openai_responses_conversion.py test/components/generators/chat/test_openai_responses.py test/components/generators/chat/test_azure_responses.py -m 'not integration' -q — 93 passed, 23 deselected.
  • Ruff lint and format checks passed for the changed Python files.

Notes for the reviewer

The change uses the completed item's reasoning_text entries only when the same output item has not already emitted reasoning text, preventing duplicate text while keeping the existing summary-delta path intact.

AI assistance was used to prepare the implementation and tests. Validation results are listed above.

@Amazinghorseli
Amazinghorseli requested a review from a team as a code owner October 2, 2026 11:14
@Amazinghorseli
Amazinghorseli requested review from bogdankostic and removed request for a team October 2, 2026 11:14
@vercel

vercel Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

@Amazinghorseli is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant

CLAassistant commented Oct 2, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenAIResponsesChatGenerator: streamed reasoning text (chunk.item.content[].text) is dropped

2 participants