{"record":{"id":"885db7a7b6b32576","repo":"HKUDS/Vibe-Trading","slug":"sse-connection-failed-with-status-response-status","errorCode":null,"errorMessage":"SSE connection failed with status {response.status_code}","messagePattern":"SSE connection failed with status (.+?)","errorType":"error_code","errorClass":"ConnectionError","httpStatus":null,"severity":"error","filePath":"agent/src/channels/signal.py","lineNumber":601,"sourceCode":"            raise\n        finally:\n            # Keep typing active across progress updates; stop on the final reply.\n            if not is_progress_message:\n                # Avoid immediate START->STOP for fast responses, which can be invisible\n                # in some Signal clients. Let indicator expire naturally (~15s).\n                await self._stop_typing(msg.chat_id, send_stop=False)\n\n    async def _sse_receive_loop(self) -> None:\n        \"\"\"Receive messages via Server-Sent Events (HTTP mode).\"\"\"\n        if not self._http:\n            raise RuntimeError(\"HTTP client not initialized for Signal SSE stream\")\n\n        self.logger.info(\"Started Signal message receive loop (SSE)\")\n\n        try:\n            async with self._http.stream(\"GET\", \"/api/v1/events\") as response:\n                if response.status_code != 200:\n                    raise ConnectionError(\n                        f\"SSE connection failed with status {response.status_code}\"\n                    )\n\n                self.logger.info(\"Subscribed to Signal messages via SSE\")\n\n                # Buffer for accumulating SSE data across multiple lines\n                event_buffer = []\n\n                async for line in response.aiter_lines():\n                    if not self._running:\n                        break\n\n                    # Debug: log raw SSE lines (except keepalive pings)\n                    if line and line != \":\":\n                        self.logger.debug(\"SSE line received: {}\", line[:200])\n\n                    # SSE format handling\n                    if isinstance(line, str):","sourceCodeStart":583,"sourceCodeEnd":619,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/channels/signal.py#L583-L619","documentation":"The SSE subscription request GET /api/v1/events returned a non-200 status, so the streaming connection could not be established.","triggerScenarios":"start() in HTTP mode when signal-cli rejects the events endpoint: auth required, wrong API version, or daemon version without SSE support.","commonSituations":"signal-cli too old to support /api/v1/events, or an auth token configured on signal-cli but not in the client.","solutions":["Upgrade signal-cli to a version supporting the REST SSE API","Match any configured auth token between signal-cli and channel config","Confirm endpoint path with curl -N http://host:8080/api/v1/events"],"exampleFix":null,"handlingStrategy":"retry","validationCode":"r = await http_client.get(f\"{endpoint}/api/v1/events\")\nif r.status_code != 200:\n    raise RuntimeError(f'signal-cli events endpoint: {r.status_code}')","typeGuard":null,"tryCatchPattern":"except ConnectionError as e:\n    if 'SSE connection failed' in str(e):\n        await asyncio.sleep(backoff); retry","preventionTips":["Pin a recent signal-cli version","Keep auth settings consistent between server and client"],"tags":["signal","sse","http","startup"],"backgroundTag":"sse-subscribe-failed","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}