From 85aa84ebcb821e4c375d0f4d97a783a8f290ba25 Mon Sep 17 00:00:00 2001 From: Michael YC JO Date: Thu, 20 Aug 2026 18:30:46 +0900 Subject: [PATCH] fix(tests): realign two more stream-utils passthrough cases with the #10017 control-line rules (#10796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Merged via merge-train (release/v3.8.50, batch1 2026-08-20) — static gates (typecheck/file-size/complexity/cognitive/changelog) green on the combined tree; test:unit reds observed in the boarded run were verified pre-existing on the pure release tip (unrelated flake), not caused by this PR. Thanks for the contribution! --- .../release-v3850-basereds-stream-utils-20260820.md | 1 + tests/unit/stream-utils.test.ts | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) 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 0000000000..98b62cd448 --- /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. diff --git a/tests/unit/stream-utils.test.ts b/tests/unit/stream-utils.test.ts index 380099b1b6..046e793b61 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/); });