Repository navigation
fix(sse): dedupe header-budget drop warns by drop-set fingerprint - #10397
diegosouzapw merged 2 commits into
Conversation
The 768-byte forwarded-header budget drop path emitted a full warn (with up to 20 dropped entries) on every SSE response whose headers exceeded the budget. The dropped set is usually identical across responses from the same upstream, so the repeats carried no new information — under Desktop multi-stream use this buried real errors and added event-loop serialization work. Warn once per unique drop fingerprint (sorted dropped-header names, capped at 1000 fingerprints) per process, then log at debug level. Fixes cheaper-inference#10315
|
Thanks for the clean fix — this maps directly onto the validation plan from #10315. I checked out the branch and ran the new test file plus the six related existing suites you named (chatcore-streaming-response-headers, forwarded-header-budget, chatcore-nonstreaming-response-headers, upstream-response-headers-strip, mcp-sse-response-headers-8277, middleware-header-strip-5849): 5/5 new tests pass, 32/32 related tests pass, and No changes requested — this looks merge-ready as-is. Two very minor optional notes for the future, neither blocking:
Nice work isolating this from the header-budget/priority logic itself, keeping the diff focused on the logging path only. |
6e97fbf
into
cheaper-inference:release/v3.8.50
|
Validated in local merge-train |
…eaper-inference#10397) * fix(sse): dedupe header-budget drop warns by drop-set fingerprint The 768-byte forwarded-header budget drop path emitted a full warn (with up to 20 dropped entries) on every SSE response whose headers exceeded the budget. The dropped set is usually identical across responses from the same upstream, so the repeats carried no new information — under Desktop multi-stream use this buried real errors and added event-loop serialization work. Warn once per unique drop fingerprint (sorted dropped-header names, capped at 1000 fingerprints) per process, then log at debug level. Fixes cheaper-inference#10315 * changelog: fragment for cheaper-inference#10397
…eaper-inference#10397) * fix(sse): dedupe header-budget drop warns by drop-set fingerprint The 768-byte forwarded-header budget drop path emitted a full warn (with up to 20 dropped entries) on every SSE response whose headers exceeded the budget. The dropped set is usually identical across responses from the same upstream, so the repeats carried no new information — under Desktop multi-stream use this buried real errors and added event-loop serialization work. Warn once per unique drop fingerprint (sorted dropped-header names, capped at 1000 fingerprints) per process, then log at debug level. Fixes cheaper-inference#10315 * changelog: fragment for cheaper-inference#10397
What
Fixes #10315.
buildStreamingResponseHeadersinopen-sse/handlers/chatCore/responseHeaders.tsemitted a full warn (with up to 20 dropped header entries) on every SSE response whose upstream headers exceeded the 768-byte forwarding budget. The dropped set is usually identical across responses from the same upstream, so under Desktop multi-stream use this produced dozens of identical warns per minute — burying real errors and adding event-loop serialization work.Change
Set(capped at 1000 fingerprints, cleared on overflow rather than growing unbounded).ResponseHeaderLoggerwith an optionaldebugmethod (the injecteddefaultLoggeralready has one).fingerprintDroppedHeadersand aresetDroppedHeaderWarnFingerprintstest hook.Tests
Added
tests/unit/chatcore-header-drop-warn-dedupe-10315.test.ts:Verified locally: new file passes (5/5); related existing suites pass (
chatcore-streaming-response-headers,forwarded-header-budget,chatcore-nonstreaming-response-headers,upstream-response-headers-strip,mcp-sse-response-headers-8277,middleware-header-strip-5849— 37/37;g13-combo-chatcore-golden,chatcore-translation-paths— 73/73);npm run lintclean.Changelog fragment
Added under
changelog.d/fixes/with this PR's number.