Skip to content

fix: missing streamed reasoning for Open Responses reasoning summary text events - #19661

Merged
gr2m merged 5 commits into
mainfrom
bugfix-19659-20260826041508338910
Aug 26, 2026
Merged

gr2m merged 5 commits into
mainfrom
bugfix-19659-20260826041508338910

Conversation

@ai-sdk-factory

@ai-sdk-factory ai-sdk-factory Bot commented Aug 26, 2026

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 #19660

ai-sdk-factory and others added 3 commits August 26, 2026 04:21
Co-authored-by: Astro-Han <255364436+Astro-Han@users.noreply.github.com>
Co-authored-by: Astro-Han <255364436+Astro-Han@users.noreply.github.com>
@ai-sdk-factory

Copy link
Copy Markdown
Contributor Author

Bugfix review

Outcome: approved

Reproduction replay

Status: no-longer-reproduces

The exact original reproduction completed successfully and the original bug signal did not appear.

Fixes issue

Status: fully-addresses

The transform now maps response.reasoning_summary_text.delta using its item_id and delta fields while retaining existing reasoning_text support; the done event remains non-duplicative and final summary metadata is preserved. This matches the documented event shape. (platform.openai.com)

Side effects

Risk: low

Only streams containing the previously discarded summary-text delta event gain additional reasoning-delta parts; existing text, tool-call, reasoning-text, completion, and metadata handling are unchanged.

Performance

Risk: low

The change performs one direct enqueue per incoming delta and adds no buffering, retained state, additional network work, or nonlinear processing.

Backwards compatibility

Risk: low

Existing persisted data is neither read nor migrated; newly accumulated stream results will correctly contain reasoning text that was previously empty.

Breaking changes

Risk: none

No public APIs, types, exports, accepted inputs, errors, defaults, configuration, or persisted formats change; the only observable change is the intended emission of previously dropped reasoning-delta parts.

Architecture

Risk: low

The provider-specific event translation remains localized within @ai-sdk/open-responses, uses the package's existing stream abstraction and event union, and introduces no dependencies, cross-package source imports, exports, or misplaced shared helpers.

Change scope

Status: minimal

The diff contains only the one-branch production fix, a representative SSE fixture, a focused regression test, and the required patch changeset.

Security

Risk: low

The change adds no credentials, URL handling, parsing mechanisms, dynamic execution, or mutable shared state; it forwards two existing string fields through an established stream path.

Testing

Status: appropriate

The fixture covers start, two summary deltas, the ignored done event, authoritative final summary metadata, and stream completion; existing reasoning-text fixtures continue to exercise compatibility, and the end-to-end replay verifies streamText behavior.

Verification

Reviewed every changed hunk and relevant stream/type paths. The focused language-model suite passed all 46 tests in both Node and Edge configurations, package type checking passed, changed-file lint and formatting checks passed, git diff validation was clean, and the authoritative reproduction replay confirmed the bug no longer reproduces.

Relevant Documentation

@ai-sdk-factory ai-sdk-factory Bot changed the title fix: missing streamed reasoning for reasoning summary text events fix: missing streamed reasoning for Open Responses reasoning summary text events Aug 26, 2026
@ai-sdk-factory

Copy link
Copy Markdown
Contributor Author

Addressed PR comment 5427276038.

Bugfix review

Outcome: approved

Reproduction replay

Status: no-longer-reproduces

... 67 more line(s) omitted

No code changes were needed in response to the approval. I reran the previously failing full test command plus the focused package, type, formatting, and lint checks; all passed, and the immutable reproduction remains no-longer-reproduces.

@ai-sdk-factory

Copy link
Copy Markdown
Contributor Author

Bugfix review

Outcome: approved

Reproduction replay

Status: no-longer-reproduces

The exact original reproduction completed successfully and the original bug signal did not appear.

Fixes issue

Status: fully-addresses

The transform now maps response.reasoning_summary_text.delta item_id and delta fields to reasoning-delta parts while preserving reasoning start, end, and final summary metadata.

Side effects

Risk: low

Only streams containing the previously discarded summary-text delta event gain reasoning-delta parts; existing reasoning_text, text, tool-call, completion, and metadata paths remain unchanged.

Performance

Risk: low

The change performs one existing-style enqueue per incoming delta and introduces no buffering, retained state, additional network work, or nonlinear processing.

Backwards compatibility

Risk: low

Existing stored data is untouched; newly collected stream results may now contain the reasoning text that was previously omitted.

Breaking changes

Risk: none

No public APIs, types, exports, accepted inputs, errors, defaults, configuration, or persisted formats change; the only observable difference is the intended emission of previously dropped reasoning-delta parts.

Architecture

Risk: low

The provider-specific event translation remains localized in @ai-sdk/open-responses and adds no dependencies, cross-package source imports, exports, or misplaced shared abstractions.

Change scope

Status: minimal

The four-file diff consists solely of the mapping branch, a representative SSE fixture, focused regression coverage, and the required patch changeset.

Security

Risk: low

The change adds no URL handling, credentials, parsing mechanisms, dynamic execution, or mutable shared state and only forwards already parsed string fields.

Testing

Status: appropriate

Regression coverage verifies reasoning start, two summary deltas, reasoning end, and final summary metadata; the authoritative end-to-end replay also verifies streamText behavior.

Verification

Reviewed every changed hunk and the existing event union and stream paths. The focused language-model suite passed all 46 tests in both Node and Edge configurations; package type checking, changed-file linting and formatting, and diff validation also passed.

@ai-sdk-factory

Copy link
Copy Markdown
Contributor Author

Addressed PR comment 5428128047.

Bugfix review

Outcome: approved

Reproduction replay

Status: no-longer-reproduces

... 59 more line(s) omitted

No code changes were needed because the review approved the existing mapping, regression fixture, focused coverage, and patch changeset. I reran the Node and Edge package suites, full type checking, formatting/lint checks, and the immutable reproduction; all passed, and the reproduction remains classified as no-longer-reproduces.

@ai-sdk-factory

Copy link
Copy Markdown
Contributor Author

Bugfix review

Outcome: approved

Reproduction replay

Status: no-longer-reproduces

The exact original reproduction completed successfully and the original bug signal did not appear.

Fixes issue

Status: fully-addresses

The transform maps response.reasoning_summary_text.delta item_id and delta fields to the existing reasoning-delta shape while retaining reasoning_text support and final summary metadata.

Side effects

Risk: low

Only streams containing previously discarded reasoning-summary deltas gain additional reasoning-delta parts; other stream event branches are unchanged.

Performance

Risk: low

The fix adds one constant-time enqueue per incoming delta without buffering, additional retained state, network work, or nonlinear processing.

Backwards compatibility

Risk: low

Existing stored data is untouched; future consumers that persist stream output will now correctly receive reasoning text that was previously omitted.

Breaking changes

Risk: none

No public APIs, types, exports, accepted inputs, errors, defaults, configuration, or persisted formats change; the observable output correction is limited to previously dropped reasoning deltas.

Architecture

Risk: low

Provider-specific event translation remains localized in @ai-sdk/open-responses and introduces no dependencies, exports, shared abstractions, or cross-package source imports.

Change scope

Status: minimal

The four-file diff contains only the event mapping, a representative fixture, focused regression coverage, and the required patch changeset.

Security

Risk: low

The change only forwards already parsed string fields through an established stream path and adds no URL handling, credentials, dynamic execution, or mutable shared state.

Testing

Status: appropriate

Regression coverage verifies start, two summary deltas, the non-duplicative done event, reasoning end, and authoritative final summary metadata in both Node and Edge environments.

Verification

Inspected every merge-base diff hunk, the streaming transform, event union, package exports, and analogous provider handling. Both Node and Edge package suites passed 89 tests, workspace type checking passed, changed TypeScript files passed lint and formatting checks, and diff validation was clean.

Relevant Documentation

@gr2m
gr2m merged commit a0d2e8c into main Aug 26, 2026
57 checks passed
@gr2m
gr2m deleted the bugfix-19659-20260826041508338910 branch August 26, 2026 17:54
gr2m added a commit that referenced this pull request Aug 26, 2026
…ummary text events (#19747)

## 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

---------

Co-authored-by: ai-sdk-factory[bot] <305873210+ai-sdk-factory[bot]@users.noreply.github.com>
Co-authored-by: ai-sdk-factory <308175966+ai-sdk-factory@users.noreply.github.com>
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
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.

@ai-sdk/open-responses: response.reasoning_summary_text.delta is silently dropped, so the standard reasoning carrier streams no reasoning-delta

2 participants