{"record":{"id":"13ed9dc011c5af6e","repo":"NousResearch/hermes-agent","slug":"provider-returned-an-empty-stream-with-no-events","errorCode":null,"errorMessage":"Provider returned an empty stream with no events (possible upstream error or malformed event stream).","messagePattern":"Provider returned an empty stream with no events \\(possible upstream error or malformed event stream\\)\\.","errorType":"exception","errorClass":"EmptyStreamError","httpStatus":null,"severity":"error","filePath":"agent/chat_completion_helpers.py","lineNumber":4003,"sourceCode":"                        if delta_type == \"text_delta\":\n                            text = getattr(delta, \"text\", \"\")\n                            if text and not has_tool_use:\n                                _fire_first_delta()\n                                agent._fire_stream_delta(text)\n                                deltas_were_sent[\"yes\"] = True\n                        elif delta_type == \"thinking_delta\":\n                            thinking_text = getattr(delta, \"thinking\", \"\")\n                            if thinking_text:\n                                _fire_first_delta()\n                                agent._fire_reasoning_delta(thinking_text)\n            if not agent._interrupt_requested:\n                raw_stream = _stream_context[\"stream\"]\n                if raw_stream is not None:\n                    try:\n                        base_final_message = raw_stream.get_final_message()\n                    except AssertionError:\n                        if not saw_stream_event:\n                            raise EmptyStreamError(\n                                \"Provider returned an empty stream with no events \"\n                                \"(possible upstream error or malformed event stream).\"\n                            ) from None\n                        raise\n        finally:\n            try:\n                _close_managed_stream()\n            finally:\n                manager = _stream_context[\"manager\"]\n                if manager is not None:\n                    manager.__exit__(None, None, None)\n\n        if agent._interrupt_requested:\n            return None\n\n        def _tool_use_dropped_mid_stream(message) -> bool:\n            \"\"\"True when the stream died mid tool call (#80498 sibling).\n","sourceCodeStart":3985,"sourceCodeEnd":4021,"githubUrl":"https://github.com/NousResearch/hermes-agent/blob/c896c09c42910c584c4c7d2325b58c14713ea42c/agent/chat_completion_helpers.py#L3985-L4021","documentation":"Error \"Provider returned an empty stream with no events (possible upstream error or malformed event stream).\" thrown in NousResearch/hermes-agent.","triggerScenarios":"Thrown at agent/chat_completion_helpers.py:4003 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","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."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c896c09c42910c584c4c7d2325b58c14713ea42c","analyzedAt":"2026-08-14T17:18:01.089Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}