Repository navigation
fix(sse): label HTTP 499 disconnects as client_disconnected - #8552
Conversation
Preserve caller-supplied error type/code in buildErrorBody so stream abort classification is not overwritten by the status-code table.
|
Thanks for the fix — this closes a real gap: I re-ran the included tests plus the neighboring 499/combo/chatCore suites on the PR head and everything passes (114 tests total), and One tiny, non-blocking nit for a future pass: |
8ad17ed to
6498f12
Compare
6498f12 to
0061d42
Compare
Thanks for the thorough review — really appreciate you checking the tests, typecheck, and that nothing keyed off the old 499 shape. Addressed the docs nit in 0061d42: |
553a073
into
cheaper-inference:release/v3.8.49
…inference#8552) * fix(sse): label HTTP 499 disconnects as client_disconnected Preserve caller-supplied error type/code in buildErrorBody so stream abort classification is not overwritten by the status-code table. * docs(security): document buildErrorBody classification arg --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com>
…inference#8552) * fix(sse): label HTTP 499 disconnects as client_disconnected Preserve caller-supplied error type/code in buildErrorBody so stream abort classification is not overwritten by the status-code table. * docs(security): document buildErrorBody classification arg --------- Co-authored-by: Diego Rodrigues de Sa e Souza <diegosouza.pw@gmail.com>
Summary
client_disconnectedinERROR_TYPES/ default messages so disconnects are not logged asinvalid_request_errorwith an empty code.buildErrorBody()keep an optional caller-suppliedtype/codeinstead of always re-deriving from the status table.createStreamFailureFinalizersso abort handling reaches the request log correctly.Fixes #8535
Test plan
node --import tsx/esm --test tests/unit/error-config.test.ts tests/unit/stream-failure-499-classification.test.ts tests/unit/error-message-sanitization.test.ts(42/42 pass)Made with Cursor