Skip to content

[v6.0] fix: missing streamed reasoning for Open Responses reasoning summary text events - #19747

Merged
gr2m merged 3 commits into
release-v6.0from
backport-19659-20260826175404413548
Aug 26, 2026
Merged

gr2m merged 3 commits into
release-v6.0from
backport-19659-20260826175404413548

Conversation

@ai-sdk-factory

Copy link
Copy Markdown
Contributor

Background

OpenAI-compatible Responses streams using the standard reasoning summary carrier emitted reasoning start and end events but omitted the streamed text, leaving callers with empty reasoning until final metadata arrived.

Root Cause

The Open Responses transform handled the LM Studio response.reasoning_text.delta extension but omitted the standard response.reasoning_summary_text.delta event even though it was already in the event union; the regression fixture and immutable reproduction confirmed the events parsed successfully but were silently discarded.

Summary

The transform now maps standard reasoning summary text deltas to reasoning-delta parts using item_id while preserving extension support and authoritative final summary metadata. The pull request includes a representative SSE fixture, focused regression coverage, and a patch changeset, with no dependency or configuration changes.

Testing

Regression coverage verifies reasoning start, two streamed summary deltas, reasoning end, and final summary metadata. All 89 Open Responses tests passed in both Node and Edge environments, full repository type checking passed, formatting and lint checks passed, and the immutable reproduction no longer reproduces the issue.

End-to-end Validation

  • pnpm -C examples/ai-functions exec tsx src/reproduction/issue-19659-open-responses-reasoning-summary.ts exited 0, streamed Thinking. through two reasoning deltas, matched final summary metadata, and was classified no-longer-reproduces.

Related Issues

Fixes #19659

Closes #19684

Backport of #19661

ai-sdk-factory Bot and others added 2 commits August 26, 2026 17:56
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
@ai-sdk-factory

Copy link
Copy Markdown
Contributor Author

Bugfix review

Outcome: approved

Fixes issue

Status: fully-addresses

The transform now maps response.reasoning_summary_text.delta events to reasoning-delta parts using the documented item_id and delta fields, while preserving existing reasoning_text support.

Side effects

Risk: low

The only runtime behavior change is emitting previously discarded standard reasoning-summary deltas; existing reasoning, text, tool-call, completion, and done-event handling remains unchanged.

Performance

Risk: low

The change performs one constant-time enqueue per reasoning-summary delta and introduces no buffering, aggregation, new collections, or retained state.

Backwards compatibility

Risk: none

No persistence code or stored-data format is touched; the new path only affects transient streaming output.

Breaking changes

Risk: none

No public API, type, export, accepted input, configuration, default, error behavior, or persisted format changes; the added reasoning-delta parts conform to the existing stream contract and restore intended behavior.

Architecture

Risk: none

The fix remains localized to the Open Responses provider's existing stream adapter, uses its existing event union and stream-part abstraction, and adds no dependencies or cross-package source imports.

Change scope

Status: minimal

All four changed files are necessary: one localized mapping change, one representative SSE fixture, one regression test, and the required patch changeset.

Security

Risk: none

The change adds no parsing, evaluation, credential, network, or persistence behavior; it forwards a documented string delta through an existing typed stream event.

Testing

Status: appropriate

The regression fixture covers start, two summary deltas with matching item IDs, the summary done event, and reasoning end. Complete Open Responses Node and Edge suites passed with 64 tests each.

Verification

Reviewed the complete merge-base diff and event union, compared the backport with the upstream fix, and inspected package exports and boundaries. Node and Edge tests, package type-check, package build, formatting/lint checks, and git diff validation all passed.

Relevant Documentation

@gr2m
gr2m merged commit 2adee9b into release-v6.0 Aug 26, 2026
48 checks passed
@gr2m
gr2m deleted the backport-19659-20260826175404413548 branch August 26, 2026 18:54
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.

2 participants