{"record":{"id":"4b009967a14faab3","repo":"HKUDS/nanobot","slug":"signal-sse-stream-closed-by-remote-endpoint","errorCode":null,"errorMessage":"Signal SSE stream closed by remote endpoint","messagePattern":"Signal SSE stream closed by remote endpoint","errorType":"exception","errorClass":"ConnectionError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/signal/runtime.py","lineNumber":666,"sourceCode":"                                    self.logger.warning(\n                                        \"Invalid JSON in SSE buffer: {}, data: {}\",\n                                        e,\n                                        data_str[:200],\n                                    )\n                                finally:\n                                    event_buffer = []\n\n                        # \"data:\" line - accumulate it\n                        elif line.startswith(\"data:\"):\n                            # SSE spec: strip one optional leading space after \"data:\".\n                            event_buffer.append(line[6:] if line[5:6] == \" \" else line[5:])\n\n                        # \"event:\" line - just log it (we only care about data)\n                        elif line.startswith(\"event:\"):\n                            pass  # Ignore event type for now\n\n                if self._running:\n                    raise ConnectionError(\"Signal SSE stream closed by remote endpoint\")\n\n        except asyncio.CancelledError:\n            self.logger.info(\"SSE receive loop cancelled\")\n            raise\n        except Exception as e:\n            self.logger.error(\"Error in SSE receive loop: {}\", e)\n            raise\n\n    @asynccontextmanager  # pyright: ignore[reportDeprecated]\n    async def _safe_handle(self, action: str, payload: Any = None) -> AsyncIterator[None]:\n        \"\"\"Swallow and log any exception from a top-level handler block.\n\n        Logs `self.logger.error` with the action name, the exception, and a\n        bounded ``repr`` of the offending payload so the offending input is\n        recoverable from logs without having to correlate by timestamp.\n        \"\"\"\n        try:\n            yield","sourceCodeStart":648,"sourceCodeEnd":684,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/signal/runtime.py#L648-L684","documentation":"Error \"Signal SSE stream closed by remote endpoint\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/signal/runtime.py:666 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}