From f404915871ae87aa5173a03e861ec66391eb1b20 Mon Sep 17 00:00:00 2001 From: awork Date: Fri, 16 Oct 2026 02:23:18 +0800 Subject: [PATCH] test: keep issue1086 T5 filler under the #3289 output text-run lane (#3315 sub-defect 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The T5 liveness fake upstream echoed "x".repeat(360) per turn. #3289's output-side runaway guard trips at TEXT_RUN_THRESHOLD=200 identical codepoints (src/runaway-guard.ts), aborting every such stream — so each turn lost its visible reply and the suite failed deterministically (25 !== 60) on every tree containing #3289: master push run 38767006158 and PR #3275 run 38776693851, plus local repro (35 guard trips). Mixed-char filler "xyz".repeat(120) keeps the identical 360-byte payload size (all assertions depend on length/byte count only) while maxTextRun drops to 1. Guard behavior itself is untouched — #3289 is intentional production behavior; the fixture simply must not emit pathological runs. Verified: node --import tsx --test tests/issue1086-chain-self-exemption.test.ts -> 21/21 pass, 0 guard trips (was 35). --- tests/issue1086-chain-self-exemption.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/issue1086-chain-self-exemption.test.ts b/tests/issue1086-chain-self-exemption.test.ts index 6560759081..b926286de8 100644 --- a/tests/issue1086-chain-self-exemption.test.ts +++ b/tests/issue1086-chain-self-exemption.test.ts @@ -543,7 +543,10 @@ test("#1086 T5 liveness: plain-client chat session keeps compressing as it grows })); res.write(sseLine({ id: "g1", object: "chat.completion.chunk", choices: [{ index: 0, delta: {}, finish_reason: "tool_calls" }], usage: { prompt_tokens: 100, completion_tokens: 2 } })); } else { - const text = `reply ${state.bodies.length} ` + "x".repeat(360); + // #3315: mixed-char filler on purpose — a uniform run of >= 200 identical codepoints + // trips the #3289 output-side text-run guard (TEXT_RUN_THRESHOLD, src/runaway-guard.ts) + // and the proxy aborts the upstream stream, so the turn loses its visible reply. + const text = `reply ${state.bodies.length} ` + "xyz".repeat(120); res.write(sseLine({ id: "g1", object: "chat.completion.chunk", choices: [{ index: 0, delta: { role: "assistant", content: text } }] })); res.write(sseLine({ id: "g1", object: "chat.completion.chunk", choices: [{ index: 0, delta: {}, finish_reason: "stop" }], usage: { prompt_tokens: 100, completion_tokens: 50 } })); }