fix(provider): handle SSE reader cancel rejections (#44944)

This commit is contained in:
Alex
2026-09-02 06:28:47 +02:00
committed by GitHub
parent 82b665075b
commit 69c172e8a7
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ function wrapSSE(res: Response, ms: number, ctl: AbortController) {
const id = setTimeout(() => {
const err = new Error("SSE read timed out")
ctl.abort(err)
void reader.cancel(err)
reader.cancel(err).catch(() => {})
reject(err)
}, ms)
+1 -1
View File
@@ -46,7 +46,7 @@ function wrapSSE(res: Response, ms: number, ctl: AbortController) {
const id = setTimeout(() => {
const err = new ProviderError.ResponseStreamError("SSE read timed out")
ctl.abort(err)
void reader.cancel(err)
reader.cancel(err).catch(() => {})
reject(err)
}, ms)
@@ -81,7 +81,7 @@ describe("v2 pty HttpApi", () => {
expect(body.data.title).toBe("v2")
// The canonical surface keeps exited sessions observable with their exit code.
const deadline = Date.now() + 5_000
const deadline = Date.now() + 20_000
let info: { status: string; exitCode?: number } | undefined
while (Date.now() < deadline) {
const found = await request(`/api/pty/${body.data.id}`, tmp.path)