From 34d3997eeb174bd25a8f35d975146c1765204c8a Mon Sep 17 00:00:00 2001 From: Michael Youngchan JO Date: Thu, 20 Aug 2026 06:45:17 +0900 Subject: [PATCH 1/2] fix(tests): realign stream-utils passthrough cases with the #10017 control-line rules MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two passthrough cases still asserted the pre-#10017 framing and have been red on release/v3.8.50 since. #10473 stopped forwarding upstream SSE control lines, but only added new coverage — it left these two behind. The event-boundary case is an OpenAI Responses scenario (its fixture emits response.output_text.delta against a responses-model), so it now declares clientResponseFormat accordingly; `event:` framing is forwarded exactly for that format and for Claude Messages. The metadata case cannot be fixed by declaring a format: `:` comments, `id:` and `retry:` are dropped for every client format, since none of the three supported SSE protocols define them. Its expectation now pins what the case is actually about — the surviving lines stay inside ONE event instead of being split by blank lines — and asserts the dropped lines are gone. --- tests/unit/stream-utils.test.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/unit/stream-utils.test.ts b/tests/unit/stream-utils.test.ts index 380099b1b6a9..046e793b6124 100644 --- a/tests/unit/stream-utils.test.ts +++ b/tests/unit/stream-utils.test.ts @@ -706,6 +706,7 @@ test("createSSEStream passthrough forwards data only after the complete SSE even { mode: "passthrough", sourceFormat: FORMATS.OPENAI, + clientResponseFormat: FORMATS.OPENAI_RESPONSES, provider: "openai", model: "responses-model", body: { @@ -747,8 +748,13 @@ test("createSSEStream passthrough preserves event metadata in a single SSE event } ); - assert.match(text, /^: upstream-note\nid: 42\ntrace: upstream-abc\ndata: /); - assert.doesNotMatch(text, /^: upstream-note\n\nid: 42/s); + // #10017 drops `:` comments, `id:` and `retry:` for every client format — none of + // the OpenAI Chat-Completions, OpenAI Responses or Claude Messages protocols define + // them. What this case still pins is the framing: the surviving lines stay inside ONE + // event instead of being split apart by blank lines. + assert.match(text, /^trace: upstream-abc\ndata: /); + assert.doesNotMatch(text, /: upstream-note/); + assert.doesNotMatch(text, /\bid: 42\b/); assert.doesNotMatch(text, /\ntrace: upstream-abc\n\n/s); assert.match(text, /metadata content/); }); From 25ceae74538243264137f0476c4c07fe956d585e Mon Sep 17 00:00:00 2001 From: Michael Youngchan JO Date: Thu, 20 Aug 2026 08:36:59 +0900 Subject: [PATCH 2/2] docs(changelog): note the stream-utils framing realignment --- .../maintenance/release-v3850-basereds-stream-utils-20260820.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/maintenance/release-v3850-basereds-stream-utils-20260820.md diff --git a/changelog.d/maintenance/release-v3850-basereds-stream-utils-20260820.md b/changelog.d/maintenance/release-v3850-basereds-stream-utils-20260820.md new file mode 100644 index 000000000000..98b62cd4480f --- /dev/null +++ b/changelog.d/maintenance/release-v3850-basereds-stream-utils-20260820.md @@ -0,0 +1 @@ +- **fix(tests):** realign the two `stream-utils` passthrough cases that still asserted the pre-#10017 SSE framing — the event-boundary case declares the OpenAI Responses client format it actually exercises, and the metadata case now pins that surviving lines stay inside one event instead of expecting the `:`/`id:` control lines that #10473 stopped forwarding to every client format.