diegosouzapw/OmniRoute · error · Error
Empty HyperAgent stream body
Error message
Empty HyperAgent stream body
What it means
Validation in parseHyperAgentSseStream: the HyperAgent response body exists but the SSE stream yielded no content (empty body after reading). The request nominally succeeded but produced no events, so there is no assistant text or session id to return — typically a session/cookie issue or an upstream soft failure.
Solutions
- Retry the request once — empty streams are often transient
- If persistent, refresh the HyperAgent session cookie
- Treat as a connection-level failure so fallback/combo can route to another provider
Defensive patterns
Strategy: retry
When it happens
Trigger: Thrown at open-sse/executors/hyperagent.ts:690 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/6ec81d68424c8eb8.
Report an issue: GitHub.
Appendix: source
Thrown at open-sse/executors/hyperagent.ts:690
debug: false,
// No connectors — empty list (SPA execution capture).
enabledIntegrations: [],
integrationMode: "open",
globalTablesEnabled: true,
// NO injectPlanMode → execution mode (plan mode was injectPlanMode:true).
// NO modelId / model → set via configureHyperAgentThread PATCH.
};
}
/**
* Parse HyperAgent SSE stream into assistant text (+ sessionId).
* Accumulates `type:"text"` content; ignores thinking for the OpenAI body.
*/
export async function parseHyperAgentSseStream(
response: Response
): Promise<{ text: string; sessionId: string; modelId: string; events: number }> {
if (!response.body) {
throw new Error("Empty HyperAgent stream body");
}
const reader = response.body.getReader();
const decoder = new TextDecoder();
let buffer = "";
let text = "";
let sessionId = "";
let modelId = "";
let events = 0;
const handleData = (payload: string) => {
const trimmed = payload.trim();
if (!trimmed || trimmed === "[DONE]") return;
let obj: Record<string, unknown>;
try {
obj = JSON.parse(trimmed) as Record<string, unknown>;
} catch {
return;
}View on GitHub (pinned to a179ffed5b)