GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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
Filter options
  • packages
    • core/src
      • aisdk.ts
    • opencode
      • src/provider
        • provider.ts
      • test/server
        • httpapi-v2-pty.test.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/core/src/aisdk.ts‎

Copy file name to clipboardExpand all lines: packages/core/src/aisdk.ts
+1-1Lines 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

Collapse file

‎packages/opencode/src/provider/provider.ts‎

Copy file name to clipboardExpand all lines: packages/opencode/src/provider/provider.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function wrapSSE(res: Response, ms: number, ctl: AbortController) {
4646
const id = setTimeout(() => {
4747
const err = new ProviderError.ResponseStreamError("SSE read timed out")
4848
ctl.abort(err)
49-
void reader.cancel(err)
49+
reader.cancel(err).catch(() => {})
5050
reject(err)
5151
}, ms)
5252

Collapse file

‎packages/opencode/test/server/httpapi-v2-pty.test.ts‎

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 numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe("v2 pty HttpApi", () => {
8181
expect(body.data.title).toBe("v2")
8282

8383
// 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
8585
let info: { status: string; exitCode?: number } | undefined
8686
while (Date.now() < deadline) {
8787
const found = await request(`/api/pty/${body.data.id}`, tmp.path)

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.