GeezerVison is showing github.com — fix(provider): handle SSE reader cancel rejections (#44944) · chid/opencode@69c172e
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: packages/core/src/aisdk.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -35,7 +35,7 @@ function wrapSSE(res: Response, ms: number, ctl: AbortController) { |
35 | 35 | const id = setTimeout(() => { |
36 | 36 | const err = new Error("SSE read timed out") |
37 | 37 | ctl.abort(err) |
38 | | - void reader.cancel(err) |
| 38 | + reader.cancel(err).catch(() => {}) |
39 | 39 | reject(err) |
40 | 40 | }, ms) |
41 | 41 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/src/provider/provider.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -46,7 +46,7 @@ function wrapSSE(res: Response, ms: number, ctl: AbortController) { |
46 | 46 | const id = setTimeout(() => { |
47 | 47 | const err = new ProviderError.ResponseStreamError("SSE read timed out") |
48 | 48 | ctl.abort(err) |
49 | | - void reader.cancel(err) |
| 49 | + reader.cancel(err).catch(() => {}) |
50 | 50 | reject(err) |
51 | 51 | }, ms) |
52 | 52 |
|
|
Collapse file
Copy file name to clipboardExpand all lines: packages/opencode/test/server/httpapi-v2-pty.test.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -81,7 +81,7 @@ describe("v2 pty HttpApi", () => { |
81 | 81 | expect(body.data.title).toBe("v2") |
82 | 82 |
|
83 | 83 | // The canonical surface keeps exited sessions observable with their exit code. |
84 | | - const deadline = Date.now() + 5_000 |
| 84 | + const deadline = Date.now() + 20_000 |
85 | 85 | let info: { status: string; exitCode?: number } | undefined |
86 | 86 | while (Date.now() < deadline) { |
87 | 87 | const found = await request(`/api/pty/${body.data.id}`, tmp.path) |
|