HKUDS/Vibe-Trading · error · ConnectionError
Signal SSE stream ended unexpectedly
Error message
Signal SSE stream ended unexpectedly
What it means
Raised when the supervised SSE task (/api/v1/events stream) exits while the channel is still supposed to be running; the connector treats it as an unexpected disconnect.
Source
Thrown at agent/src/channels/signal.py:494
else:
raise ConnectionRefusedError(
f"signal-cli daemon check returned status {response.status_code}"
)
except Exception as e:
raise ConnectionRefusedError(f"signal-cli daemon not responding: {e}")
# Reset reconnect delay after successful connection check.
reconnect_delay_s = 1.0
# Ensure account-level typing indicators are enabled.
await self._ensure_typing_indicators_enabled()
# Start SSE receiver and supervise it. If it exits while we're still
# running, treat it as a disconnect and reconnect.
self._sse_task = asyncio.create_task(self._sse_receive_loop())
await self._sse_task
if self._running:
raise ConnectionError("Signal SSE stream ended unexpectedly")
except asyncio.CancelledError:
break
except ConnectionRefusedError as e:
self.logger.error(
"{}. Make sure signal-cli daemon is running: "
"signal-cli -a {} daemon --http {}:{}",
e,
self.config.phone_number,
self.config.daemon_host,
self.config.daemon_port,
)
except Exception as e:
self.logger.error("Signal channel error: {}", e)
finally:
if self._sse_task:
if not self._sse_task.done():
self._sse_task.cancel()View on GitHub (pinned to 80ffdda44c)
Solutions
- Ensure any proxy in front of signal-cli disables buffering and extends read timeouts for /api/v1/events
- Restart/reconnect logic: the loop retries; confirm signal-cli stays up
- Check signal-cli logs for why the stream ended
Defensive patterns
Strategy: retry
Try / catch
except ConnectionError as e:
if 'SSE stream ended' in str(e):
log.warning('SSE ended; channel loop will reconnect') Prevention
- Keep the channel's supervised loop running so it reconnects
- Tune proxy read timeouts for /api/v1/events
When it happens
Trigger: signal-cli closes the SSE event stream (restart, idle timeout, proxy cutting the stream) while _running is true.
Common situations: Reverse proxy (nginx) timing out long-lived SSE connections, signal-cli restarting, or network interruption.
Related errors
- signal-cli daemon check returned status {response.status_cod
- signal-cli daemon not responding: {e}
- SSE connection failed with status {response.status_code}
- Signal SSE stream closed by remote endpoint
- OpenAI Codex response failed: {str(detail)[:500]}
AI-assisted analysis of HKUDS/Vibe-Trading@80ffdda44c (2026-08-28).
Data as JSON: /api/errors/b10279033a5489aa.
Report an issue: GitHub.