You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
VAD gate keepalive interval too long — risks DG 1011 disconnect #5234
The VAD gate's KeepAlive interval is set to 20 seconds (VAD_GATE_KEEPALIVE_SEC = 20 in backend/utils/stt/vad_gate.py:41), but Deepgram's idle timeout is 10 seconds (not 30s as originally assumed).
If no audio or KeepAlive is sent within 10 seconds, DG closes the WebSocket with error code 1011 (NET-0001).
Impact
Users WITHOUT speech profile in quiet environments: gate starts in active mode, classifies initial silence, sends nothing to DG for 10+ seconds → DG disconnects
Users WITH speech profile: not affected (gate starts in shadow mode, sends all audio for first ~15-25s)
Currently mitigated by most users having speech profiles, but this is a latent bug
Root Cause
Code comment at line 717 says "Prevent DG 30s idle timeout" — the 30s assumption was wrong. DG docs specify 10s timeout and recommend KeepAlive every 3-5 seconds.
Acceptance Criteria
KeepAlive interval reduced to match DG's 10s timeout (recommended: 5s)
Reproduce the 1011 error with the current 20s interval before fixing
Verify the fix prevents 1011 under initial silence conditions
All existing tests pass
No behavior change for speech-profile users (shadow mode unaffected)
Files
backend/utils/stt/vad_gate.py — VAD_GATE_KEEPALIVE_SEC constant and needs_keepalive() method
Activity
Fix VAD gate keepalive interval: 20s → 5s to prevent DG 1011
Fix VAD gate keepalive interval: 20s → 5s to prevent DG 1011