Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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.
10 changes: 8 additions & 2 deletions tests/unit/stream-utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down Expand Up @@ -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/);
});
Expand Down
Loading