NousResearch/hermes-agent · error · EmptyStreamError
Provider returned an empty stream with no events (possible u
Error message
Provider returned an empty stream with no events (possible upstream error or malformed event stream).
What it means
Error "Provider returned an empty stream with no events (possible upstream error or malformed event stream)." thrown in NousResearch/hermes-agent.
Source
Thrown at agent/chat_completion_helpers.py:4003
if delta_type == "text_delta":
text = getattr(delta, "text", "")
if text and not has_tool_use:
_fire_first_delta()
agent._fire_stream_delta(text)
deltas_were_sent["yes"] = True
elif delta_type == "thinking_delta":
thinking_text = getattr(delta, "thinking", "")
if thinking_text:
_fire_first_delta()
agent._fire_reasoning_delta(thinking_text)
if not agent._interrupt_requested:
raw_stream = _stream_context["stream"]
if raw_stream is not None:
try:
base_final_message = raw_stream.get_final_message()
except AssertionError:
if not saw_stream_event:
raise EmptyStreamError(
"Provider returned an empty stream with no events "
"(possible upstream error or malformed event stream)."
) from None
raise
finally:
try:
_close_managed_stream()
finally:
manager = _stream_context["manager"]
if manager is not None:
manager.__exit__(None, None, None)
if agent._interrupt_requested:
return None
def _tool_use_dropped_mid_stream(message) -> bool:
"""True when the stream died mid tool call (#80498 sibling).
View on GitHub (pinned to c896c09c42)
Solutions
- Retry; an event-less stream usually indicates an upstream hiccup or proxy interference.
- Check any proxy/gateway in front of the provider for SSE rewriting.
- Verify the provider and model support streaming and the request is well-formed.
When it happens
Trigger: Thrown at agent/chat_completion_helpers.py:4003 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of NousResearch/hermes-agent@c896c09c42 (2026-08-14).
Data as JSON: /api/errors/13ed9dc011c5af6e.
Report an issue: GitHub.