MCPcopy Index your code
hub / github.com/anomalyco/opencode / fetch

Function fetch

packages/opencode/test/session/retry.test.ts:356–368  ·  view source on GitHub ↗
(_req)

Source from the content-addressed store, hash-verified

354 port: 0,
355 idleTimeout: 8,
356 async fetch(_req) {
357 return new Response(
358 new ReadableStream({
359 async pull(controller) {
360 controller.enqueue("Hello,")
361 await sleep(10000)
362 controller.enqueue(" World!")
363 controller.close()
364 },
365 }),
366 { headers: { "Content-Type": "text/plain" } },
367 )
368 },
369 })
370
371 const error = await fetch(new URL("/", server.url.origin))

Callers 1

retry.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected