agents icon indicating copy to clipboard operation
agents copied to clipboard

simplismart STT: a silently dropped WebSocket is never detected

Open sidxh opened this issue 2 months ago • 0 comments

Bug Description

On a half-open connection (no FIN, no RST) the Simplismart STT SpeechStream sits on a dead socket forever: the session stays open, no transcripts arrive, and nothing is ever logged. Same class of bug as #7206 (Deepgram v1), #7356 (Soniox), #7358 (Telnyx) and #7363 (xAI), still present in livekit-plugins-simplismart.

_connect_ws opens the socket without heartbeat, so recv_task parks on ws.receive() and the reconnect in _run, which only fires when that task ends, never gets a turn. There is no keepalive task in this plugin, so nothing else touches the socket when audio stops. And when a heartbeat is on, the resulting WSMsgType.ERROR hits the "unexpected simplismart message type" branch and is stepped over; the loop only ends because a CLOSED follows, and the reason on ws.exception() is dropped.

Expected Behavior

The dropped connection is detected within the heartbeat window, the reason is logged, and the stream reconnects through the plugin's existing _reconnect_event path.

Reproduction Steps

Point the stream's ws_url at a local aiohttp WebSocket server with autoping=False that accepts the config message, answers audio frames with transcript payloads for 10s, and then stops reading, stops writing, and stops answering pings while keeping the TCP socket open. Run a real simplismart.STT(streaming=True) stream pushing 20ms silence frames for 120s.

On main: last transcript at 9.2s, no warning or error logged for the remaining 110s, one socket for the whole run.

Versions

livekit-agents 1.8.2, livekit-plugins-simplismart at main (e5024c76d), aiohttp 3.14.3, Python 3.13, macOS.

sidxh avatar Sep 20 '26 17:09 sidxh