MCPcopy Create free account
hub / github.com/anomalyco/opencode / streamRequest

Function streamRequest

packages/opencode/test/plugin/openai-ws.test.ts:776–787  ·  view source on GitHub ↗
(headers?: Record<string, string>, signal?: AbortSignal)

Source from the content-addressed store, hash-verified

774})
775
776function streamRequest(headers?: Record<string, string>, signal?: AbortSignal): RequestInit {
777 return {
778 method: "POST",
779 headers: {
780 "session-id": "session-1",
781 authorization: "Bearer test",
782 ...headers,
783 },
784 body: JSON.stringify({ stream: true, input: "hi" }),
785 signal,
786 }
787}
788
789async function readTextError(promise: Promise<string>) {
790 // Bun 1.3.14 hangs on expect(response.text()).rejects for streams errored from ws callbacks.

Callers 1

openai-ws.test.tsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected