fix: disable STT retries and stop continuous mode after 3 silent cycles

- Set max_retries=0 on the STT OpenAI client. The SDK default (2) honors
  Groq's retry-after header (often 53s), blocking the thread for up to
  ~106s on rate limits. Voice STT should fail fast, not retry silently.
- Stop continuous recording mode after 3 consecutive no-speech cycles to
  prevent infinite restart loops when nobody is talking.
This commit is contained in:
0xbyt4
2026-03-10 14:56:46 +03:00
parent 0a89933f9b
commit c3dc4448bf
2 changed files with 12 additions and 1 deletions

11
cli.py
View File

@@ -3688,6 +3688,17 @@ class HermesCLI:
except Exception:
pass
# Track consecutive no-speech cycles to avoid infinite restart loops.
if not submitted:
self._no_speech_count = getattr(self, '_no_speech_count', 0) + 1
if self._no_speech_count >= 3:
self._voice_continuous = False
self._no_speech_count = 0
_cprint(f"{_DIM}No speech detected 3 times, continuous mode stopped.{_RST}")
return
else:
self._no_speech_count = 0
# If no transcript was submitted but continuous mode is active,
# restart recording so the user can keep talking.
# (When transcript IS submitted, process_loop handles restart