diff --git a/changelog.d/maintenance/10704-basereds-sse-comments-vi-parity.md b/changelog.d/maintenance/10704-basereds-sse-comments-vi-parity.md new file mode 100644 index 0000000000..e2874a2be4 --- /dev/null +++ b/changelog.d/maintenance/10704-basereds-sse-comments-vi-parity.md @@ -0,0 +1 @@ +- **fix(tests):** drain three base-reds on the release branch — the Vietnamese locale regained parity with English (6 keys added), the chatCore SSE test now asserts the comment-free default that #10539 introduced instead of the trailer it replaced, and the Antigravity cloudcode test asserts the missing-messages guard it is named for instead of a `/ok/` regex that only ever matched the "ok" inside `: x-omniroute-tokens-in` ([#10704](https://github.com/diegosouzapw/OmniRoute/pull/10704)) diff --git a/src/i18n/messages/vi.json b/src/i18n/messages/vi.json index a18723573d..16dece1256 100644 --- a/src/i18n/messages/vi.json +++ b/src/i18n/messages/vi.json @@ -7763,6 +7763,10 @@ "terse-cjk": { "label": "CJK súc tích (文言)", "description": "Văn phong Hán cổ cực kỳ súc tích (chỉ khả dụng với tiếng Trung)." + }, + "i-have-adhd": { + "label": "Tôi bị ADHD (ưu tiên hành động)", + "description": "Đầu ra ưu tiên hành động: nêu hành động kế tiếp trước, các bước được đánh số, một bước tiếp theo cụ thể, không mở đầu dài dòng." } }, "resilienceWaitForCooldown": "Chờ thời gian hồi", @@ -8195,7 +8199,11 @@ "cliproxyapiHealth": "Sức Khỏe", "cliproxyapiPort": "Cổng", "qdrantHost": "Máy chủ", - "qdrantCollection": "Bộ Sưu Tập" + "qdrantCollection": "Bộ Sưu Tập", + "reasoningTokenBuffer": "Bộ đệm token suy luận", + "reasoningTokenBufferDesc": "Cho phép định tuyến combo thêm khoảng dư max_tokens chỉ với các mô hình suy luận đã biết, khi toàn bộ bộ đệm vẫn nằm trong giới hạn đầu ra đã biết.", + "zeroLatencyOptimizations": "Tối ưu hóa zero-latency", + "zeroLatencyOptimizationsDesc": "Bật hedging, bỏ qua TTFT theo dự đoán và nén dự phòng chủ động. Để tắt nếu bạn không muốn các tính năng độ trễ này chạy đua giữa các đích hoặc nén các yêu cầu dự phòng." }, "contextRtk": { "title": "RTK Engine", diff --git a/tests/unit/chat-messages-validation-6402.test.ts b/tests/unit/chat-messages-validation-6402.test.ts index e4931b0c54..d75c8df3f1 100644 --- a/tests/unit/chat-messages-validation-6402.test.ts +++ b/tests/unit/chat-messages-validation-6402.test.ts @@ -171,8 +171,22 @@ for (const model of ANTIGRAVITY_GEMINI_MODELS) { assert.equal(upstreamCalled, true, "Antigravity request should reach the upstream executor"); assert.equal(response.status, 200, "Antigravity cloudcode envelopes must not return 400"); + // This assertion is the guard the test is named for: a cloudcode envelope has no + // `messages` key, so it must not be rejected by the #6402 validator. + // + // It used to read `assert.match(body, /ok/)`, aimed at the mocked upstream's + // "ok" text — but that text never reached this layer. The match only ever + // succeeded on the "ok" inside `: x-omniroute-tokens-in=0`, an SSE *comment* + // trailer. When #10539 flipped OMNIROUTE_SSE_COMMENTS to off-by-default the + // trailers stopped being emitted, the body went empty, and the coincidence — + // not the behavior — broke. Content relay for this provider is covered for + // real, at the executor level, by antigravity-streaming-passthrough.test.ts. const body = await response.text(); - assert.match(body, /ok/); + assert.doesNotMatch( + body, + /messages.*Expected array/i, + "cloudcode envelope must not be caught by the missing-messages guard" + ); }); } diff --git a/tests/unit/chatcore-translation-paths.test.ts b/tests/unit/chatcore-translation-paths.test.ts index f28caccf09..482f273332 100644 --- a/tests/unit/chatcore-translation-paths.test.ts +++ b/tests/unit/chatcore-translation-paths.test.ts @@ -2597,7 +2597,7 @@ test("chatCore injects progress events into streaming responses when requested", assert.equal(result.response.headers.get("X-OmniRoute-Progress"), "enabled"); assert.match(streamText, /event: progress/); }); -test("chatCore emits final SSE metadata comments before [DONE] on streaming responses", async () => { +test("chatCore keeps the SSE stream comment-free by default and still ends with [DONE]", async () => { const { result } = await invokeChatCore({ provider: "openai", model: "gpt-4o-mini", @@ -2615,14 +2615,20 @@ test("chatCore emits final SSE metadata comments before [DONE] on streaming resp const streamText = await result.response.text(); assert.equal(result.success, true); + // The per-request metadata reaches the client through these headers regardless + // of the comment setting — that is what makes the trailer optional. assert.equal(result.response.headers.get("X-OmniRoute-Provider"), "openai"); assert.equal(result.response.headers.get("X-OmniRoute-Model"), "gpt-4o-mini"); - assert.match(streamText, /: x-omniroute-response-cost=\d+\.\d{10}/); - assert.match(streamText, /: x-omniroute-tokens-in=\d+/); - assert.match(streamText, /: x-omniroute-tokens-out=\d+/); - assert.ok( - streamText.indexOf(": x-omniroute-response-cost=") < streamText.indexOf("data: [DONE]") - ); + + // #10524 flipped OMNIROUTE_SSE_COMMENTS to off-by-default: strict SSE clients + // JSON.parse every line and crash on `: x-omniroute-*` comments. This test used + // to assert the opposite and went red on the release branch when that default + // landed. The opt-in half — trailer present, after the finish chunk and before + // [DONE] — is owned by sse-comments-optout-9305.test.ts, which drives the env + // var through all three states; enabling it here instead leaks process.env into + // the sibling call-log tests in this file. + assert.doesNotMatch(streamText, /: x-omniroute-/); + assert.match(streamText, /data: \[DONE\]/); }); test("buildStreamingResponseHeaders drops upstream compression and framing headers", () => { const headers = new Headers(