From 5fbf2181393ea7e4b40620ebae2fa7c33a058291 Mon Sep 17 00:00:00 2001 From: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com> Date: Wed, 26 Aug 2026 21:09:00 -0300 Subject: [PATCH] test(video): cover round-robin transcript error logs --- .../combo-10597-error-body-logging.test.ts | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/tests/unit/combo-10597-error-body-logging.test.ts b/tests/unit/combo-10597-error-body-logging.test.ts index a18f892716..e21fbdb91c 100644 --- a/tests/unit/combo-10597-error-body-logging.test.ts +++ b/tests/unit/combo-10597-error-body-logging.test.ts @@ -141,3 +141,40 @@ test("transcript-sensitive combo failures omit echoed transcript only from retai assert.equal(serialized.includes(transcriptSentinel), false); assert.match(serialized, /omitted: video transcript/); }); + +test("transcript-sensitive round-robin failures omit echoed transcript from retained logs", async () => { + const transcriptSentinel = "PRIVATE_COMBO_RR_ERROR_TRANSCRIPT_SENTINEL"; + const localWarnCalls: WarnCall[] = []; + const result = await handleComboChat({ + body: { model: "test", messages: [{ role: "user", content: "processed video request" }] }, + combo: { + name: "test-combo-10597-private-rr", + strategy: "round-robin", + models: [{ model: "claude/private-video-rr" }], + config: { maxRetries: 0 }, + }, + handleSingleModel: async () => + new Response(JSON.stringify({ error: { message: transcriptSentinel } }), { + status: 400, + headers: { "Content-Type": "application/json" }, + }), + log: { + info: () => {}, + debug: () => {}, + error: () => {}, + warn: (tag: string, msg: string, meta?: unknown) => { + localWarnCalls.push({ tag, msg, meta }); + }, + }, + settings: {}, + allCombos: [], + videoTranscriptSensitive: true, + }); + + assert.equal(result.ok, false); + const retainedFailure = localWarnCalls.find((call) => call.tag === "COMBO-RR"); + assert.ok(retainedFailure); + const serialized = JSON.stringify(retainedFailure); + assert.equal(serialized.includes(transcriptSentinel), false); + assert.match(serialized, /omitted: video transcript/); +});