fix: missing streamed reasoning for Open Responses reasoning summary text events - #19661
Conversation
Co-authored-by: Astro-Han <255364436+Astro-Han@users.noreply.github.com>
Bugfix reviewOutcome: approved Reproduction replayStatus: no-longer-reproduces The exact original reproduction completed successfully and the original bug signal did not appear. Fixes issueStatus: 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 effectsRisk: 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. PerformanceRisk: low The change performs one direct enqueue per incoming delta and adds no buffering, retained state, additional network work, or nonlinear processing. Backwards compatibilityRisk: low Existing persisted data is neither read nor migrated; newly accumulated stream results will correctly contain reasoning text that was previously empty. Breaking changesRisk: 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. ArchitectureRisk: 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 scopeStatus: minimal The diff contains only the one-branch production fix, a representative SSE fixture, a focused regression test, and the required patch changeset. SecurityRisk: 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. TestingStatus: 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. VerificationReviewed 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
|
|
Addressed PR comment 5427276038.
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. |
Bugfix reviewOutcome: approved Reproduction replayStatus: no-longer-reproduces The exact original reproduction completed successfully and the original bug signal did not appear. Fixes issueStatus: 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 effectsRisk: 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. PerformanceRisk: low The change performs one existing-style enqueue per incoming delta and introduces no buffering, retained state, additional network work, or nonlinear processing. Backwards compatibilityRisk: low Existing stored data is untouched; newly collected stream results may now contain the reasoning text that was previously omitted. Breaking changesRisk: 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. ArchitectureRisk: 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 scopeStatus: minimal The four-file diff consists solely of the mapping branch, a representative SSE fixture, focused regression coverage, and the required patch changeset. SecurityRisk: low The change adds no URL handling, credentials, parsing mechanisms, dynamic execution, or mutable shared state and only forwards already parsed string fields. TestingStatus: 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. VerificationReviewed 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. |
|
Addressed PR comment 5428128047.
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. |
Bugfix reviewOutcome: approved Reproduction replayStatus: no-longer-reproduces The exact original reproduction completed successfully and the original bug signal did not appear. Fixes issueStatus: 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 effectsRisk: low Only streams containing previously discarded reasoning-summary deltas gain additional reasoning-delta parts; other stream event branches are unchanged. PerformanceRisk: low The fix adds one constant-time enqueue per incoming delta without buffering, additional retained state, network work, or nonlinear processing. Backwards compatibilityRisk: low Existing stored data is untouched; future consumers that persist stream output will now correctly receive reasoning text that was previously omitted. Breaking changesRisk: 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. ArchitectureRisk: 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 scopeStatus: minimal The four-file diff contains only the event mapping, a representative fixture, focused regression coverage, and the required patch changeset. SecurityRisk: 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. TestingStatus: 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. VerificationInspected 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 |
…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>
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.deltaextension but omitted the standardresponse.reasoning_summary_text.deltaevent 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-deltaparts usingitem_idwhile 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.tsexited 0, streamedThinking.through two reasoning deltas, matched final summary metadata, and was classifiedno-longer-reproduces.Related Issues
Fixes #19659
Closes #19660