mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-20 14:12:59 +03:00
fix(tests): realign two more stream-utils passthrough cases with the #10017 control-line rules (#10796)
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!
This commit is contained in:
@@ -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.
|
||||
@@ -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/);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user