{"record":{"id":"d8e43ab3a2465862","repo":"diegosouzapw/OmniRoute","slug":"no-response-body-for-streaming","errorCode":null,"errorMessage":"No response body for streaming","messagePattern":"No response body for streaming","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"open-sse/executors/lmarena.ts","lineNumber":213,"sourceCode":"      text: tlsResult.text,\n      body: tlsResult.body,\n    });\n\n    const response = ctx.stream\n      ? await this.handleStreamingResponse(upstream, ctx.model, ctx.signal, ctx.log)\n      : await handleNonStreamingArenaResponse(upstream, ctx.model);\n\n    return { response, url, headers, transformedBody };\n  }\n\n  private async handleStreamingResponse(\n    response: Response,\n    model: string,\n    signal?: AbortSignal,\n    log?: ExecuteInput[\"log\"]\n  ): Promise<Response> {\n    const reader = response.body?.getReader();\n    if (!reader) throw new Error(\"No response body for streaming\");\n\n    const out = createOpenAIArenaStream({ reader, model, signal, log });\n    return new Response(out, {\n      status: 200,\n      headers: {\n        \"Content-Type\": \"text/event-stream\",\n        \"Cache-Control\": \"no-cache\",\n        Connection: \"keep-alive\",\n      },\n    });\n  }\n}\n","sourceCodeStart":195,"sourceCodeEnd":226,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/open-sse/executors/lmarena.ts#L195-L226","documentation":"Lmarena streaming handler requested a reader from the upstream Response but response.body was null or undefined. This happens when the upstream returned an empty or already-consumed body, making SSE streaming impossible for a request the client asked to stream.","triggerScenarios":"Thrown at open-sse/executors/lmarena.ts:213 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check response.body before choosing the streaming path and fall back to non-streaming handling","Return a 502-style upstream error response when the body is absent","Retry the upstream request once, since an empty body may be transient"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}