diegosouzapw/OmniRoute · error · Error
No response body for streaming
Error message
No response body for streaming
What it means
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.
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
Defensive patterns
Strategy: fallback
When it happens
Trigger: Thrown at open-sse/executors/lmarena.ts:213 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25).
Data as JSON: /api/errors/d8e43ab3a2465862.
Report an issue: GitHub.
Appendix: source
Thrown at open-sse/executors/lmarena.ts:213
text: tlsResult.text,
body: tlsResult.body,
});
const response = ctx.stream
? await this.handleStreamingResponse(upstream, ctx.model, ctx.signal, ctx.log)
: await handleNonStreamingArenaResponse(upstream, ctx.model);
return { response, url, headers, transformedBody };
}
private async handleStreamingResponse(
response: Response,
model: string,
signal?: AbortSignal,
log?: ExecuteInput["log"]
): Promise<Response> {
const reader = response.body?.getReader();
if (!reader) throw new Error("No response body for streaming");
const out = createOpenAIArenaStream({ reader, model, signal, log });
return new Response(out, {
status: 200,
headers: {
"Content-Type": "text/event-stream",
"Cache-Control": "no-cache",
Connection: "keep-alive",
},
});
}
}
View on GitHub (pinned to a179ffed5b)