diff --git a/changelog.d/maintenance/release-v3851-basereds-unit-rtk-golden.md b/changelog.d/maintenance/release-v3851-basereds-unit-rtk-golden.md new file mode 100644 index 0000000000..b22a00122f --- /dev/null +++ b/changelog.d/maintenance/release-v3851-basereds-unit-rtk-golden.md @@ -0,0 +1 @@ +- **compression/tests:** repair the unit base-reds on `release/v3.8.51` left by the 09-17 merge wave — RTK dedup was skipped for every unknown-type text (#13521 widened `skipFilters` to `isDocumentLikeRead`), so repeated tool output stopped compressing (12 tests); the translate-path golden, the `APIKEY_PROVIDERS` count and the G13 golden/SSE `Content-Type` assertions were stale after #12648 (xKiro) and #13419 (`charset=utf-8`). diff --git a/open-sse/services/compression/engines/rtk/index.ts b/open-sse/services/compression/engines/rtk/index.ts index 82f5a4b221..b4dba7e8a9 100644 --- a/open-sse/services/compression/engines/rtk/index.ts +++ b/open-sse/services/compression/engines/rtk/index.ts @@ -314,7 +314,7 @@ export function processRtkText( // #13388: skip dedup for non-shell tool results (file reads, grep, glob, etc.) // where repeated structural lines are semantically meaningful. Also skip when // the content is a document-like read to avoid false-positive dedup on code files. - const shouldSkipDedup = options.skipFilters || isDocumentLikeRead; + const shouldSkipDedup = Boolean(options.skipFilters); const deduped = shouldSkipDedup ? { text: result, collapsed: 0 } : deduplicateRepeatedLines(result, { threshold: config.deduplicateThreshold }); diff --git a/tests/snapshots/g13/combo-chatcore-public-seams.json b/tests/snapshots/g13/combo-chatcore-public-seams.json index bf58e93350..6235043654 100644 --- a/tests/snapshots/g13/combo-chatcore-public-seams.json +++ b/tests/snapshots/g13/combo-chatcore-public-seams.json @@ -392,7 +392,7 @@ "output": { "Cache-Control": "no-cache, no-transform", "Connection": "keep-alive", - "Content-Type": "text/event-stream", + "Content-Type": "text/event-stream; charset=utf-8", "X-Accel-Buffering": "no", "X-OmniRoute-Cache": "MISS", "X-OmniRoute-Cache-Hit": "false", @@ -416,7 +416,7 @@ "output": { "Cache-Control": "no-cache, no-transform", "Connection": "keep-alive", - "Content-Type": "text/event-stream", + "Content-Type": "text/event-stream; charset=utf-8", "X-Accel-Buffering": "no", "X-OmniRoute-Cache": "MISS", "X-OmniRoute-Cache-Hit": "false", diff --git a/tests/snapshots/provider/translate-path.json b/tests/snapshots/provider/translate-path.json index 4ea6a91560..7cc9a9b678 100644 --- a/tests/snapshots/provider/translate-path.json +++ b/tests/snapshots/provider/translate-path.json @@ -6398,6 +6398,29 @@ "stream": "https://token-plan-sgp.xiaomimimo.com/v1" } }, + "xkiro": { + "format": "openai", + "headers": { + "apiKey": { + "Accept": "text/event-stream", + "Authorization": "Bearer ", + "Content-Type": "application/json" + }, + "nonStream": { + "Authorization": "Bearer ", + "Content-Type": "application/json" + }, + "oauth": { + "Accept": "text/event-stream", + "Authorization": "Bearer ", + "Content-Type": "application/json" + } + }, + "url": { + "nonStream": "https://api.xkiro.com/v1/chat/completions", + "stream": "https://api.xkiro.com/v1/chat/completions" + } + }, "yi": { "format": "openai", "headers": { diff --git a/tests/unit/chat-route-coverage.test.ts b/tests/unit/chat-route-coverage.test.ts index db46de811e..543c4c3bb3 100644 --- a/tests/unit/chat-route-coverage.test.ts +++ b/tests/unit/chat-route-coverage.test.ts @@ -157,7 +157,7 @@ test("handleChat treats a pure Accept: text/event-stream as stream=true and retu const raw = await response.text(); assert.equal(response.status, 200); - assert.equal(response.headers.get("Content-Type"), "text/event-stream"); + assert.equal(response.headers.get("Content-Type"), "text/event-stream; charset=utf-8"); assert.ok(response.headers.get("X-OmniRoute-Session-Id")); assert.match(raw, /Accept header stream/); assert.match(raw, /\[DONE\]/); diff --git a/tests/unit/chatcore-translation-paths.test.ts b/tests/unit/chatcore-translation-paths.test.ts index b5ef7a62ba..1d5a4eea21 100644 --- a/tests/unit/chatcore-translation-paths.test.ts +++ b/tests/unit/chatcore-translation-paths.test.ts @@ -2993,7 +2993,7 @@ test("buildStreamingResponseHeaders drops upstream compression and framing heade ) ); - assert.equal(headers.get("Content-Type"), "text/event-stream"); + assert.equal(headers.get("Content-Type"), "text/event-stream; charset=utf-8"); assert.equal(headers.get("Content-Encoding"), null); assert.equal(headers.get("Content-Length"), null); assert.equal(headers.get("Transfer-Encoding"), null); @@ -3028,7 +3028,7 @@ test("chatCore strips upstream compression and length headers from streaming res }); assert.equal(result.success, true); - assert.equal(result.response.headers.get("Content-Type"), "text/event-stream"); + assert.equal(result.response.headers.get("Content-Type"), "text/event-stream; charset=utf-8"); assert.equal(result.response.headers.get("Content-Length"), null); assert.equal(result.response.headers.get("X-Upstream-Trace"), "trace-1"); assert.equal(result.response.headers.get("X-OmniRoute-Cache"), "MISS"); diff --git a/tests/unit/providers-constants-split.test.ts b/tests/unit/providers-constants-split.test.ts index da74f7db0e..6fb113f7c1 100644 --- a/tests/unit/providers-constants-split.test.ts +++ b/tests/unit/providers-constants-split.test.ts @@ -36,12 +36,13 @@ // SeekAi (#11786, QuantumNous New-API gateway) adds one gateways entry — 238. // GreenPT (#13024, 2b9e7fb3e) and EURouter (#13025, 22473dee5) each add one gateways entry — 240. // Agnes AI China (#13399, cdcde97c7) adds one apikey/regional entry — 241. +// xKiro (#12648, 83fa4328f) adds one apikey entry — 242. import { test } from "node:test"; import assert from "node:assert/strict"; const P = await import("../../src/shared/constants/providers.ts"); -const APIKEY_PROVIDER_COUNT = 241; +const APIKEY_PROVIDER_COUNT = 242; test("barrel still exports every catalog + key helpers", () => { for (const name of [