[v6.0] fix: missing streamed reasoning for Open Responses reasoning summary text events - #19747
Conversation
Co-authored-by: Gregor Martynus <39992+gr2m@users.noreply.github.com>
Bugfix reviewOutcome: approved Fixes issueStatus: 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 effectsRisk: 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. PerformanceRisk: low The change performs one constant-time enqueue per reasoning-summary delta and introduces no buffering, aggregation, new collections, or retained state. Backwards compatibilityRisk: none No persistence code or stored-data format is touched; the new path only affects transient streaming output. Breaking changesRisk: 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. ArchitectureRisk: 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 scopeStatus: minimal All four changed files are necessary: one localized mapping change, one representative SSE fixture, one regression test, and the required patch changeset. SecurityRisk: none The change adds no parsing, evaluation, credential, network, or persistence behavior; it forwards a documented string delta through an existing typed stream event. TestingStatus: 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. VerificationReviewed 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 |
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 #19684
Backport of #19661