Skip to content

Commit ac3b15b

Browse files
committed
fix(core): swallow SSE reader cancel rejection on chunk timeout
wrapSSE used `void reader.cancel(err)` on chunk timeout, which does not attach a rejection handler — if the underlying stream rejects the cancel, it surfaces as an unhandled promise rejection. Chain `.catch` instead so the timeout path can never crash the process. Ported from upstream commit 69c172e ("fix(provider): handle SSE reader cancel rejections (anomalyco#44944)"). No behavior change outside the timeout/cancel path; does not touch Batuta/Breniac/desktop code. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01AGh7o4NA8jUjwakDzZo12e
1 parent 9ef686e commit ac3b15b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/core/src/aisdk.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function wrapSSE(res: Response, ms: number, ctl: AbortController) {
3535
const id = setTimeout(() => {
3636
const err = new Error("SSE read timed out")
3737
ctl.abort(err)
38-
void reader.cancel(err)
38+
reader.cancel(err).catch(() => {})
3939
reject(err)
4040
}, ms)
4141

0 commit comments

Comments
 (0)