fix(voxtral): No-Speech-Timeout — Stille-Fenster schließt selbst

Stefans Repro: "die Stille-Ende wird nie erreicht, stop ich selbst ist es weg,
und geht automatisch auf lausche Computer". Ursache: der Endpoint feuert nur
wenn schon Stimme da war (last_voice_at>0). Bei totaler Stille bleibt
last_voice_at==0 → Endpoint feuert NIE → Fenster offen bis Hardcap/manuellem
Stop (→ stream_end → Phantom).

Fix: No-Speech-Timeout im _tick — wenn nach endpoint_ms (Stille-Toleranz) ab
Start noch KEINE Stimme kam, schließt der Bridge das Fenster selbst als
no-speech (leer, lautlos, zurück aufs Wake-Word). voiced_frames==0 →
_finalize verwirft ohne Transkript, also kein Phantom. Logik gegen totale
Stille / Sprache-dann-still / Dauer-Sprache verifiziert.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-08-16 19:38:38 +02:00
co-authored by Claude Opus 4.8
parent b226e1da11
commit c82616ebbd
+11
View File
@@ -428,6 +428,17 @@ class SessionManager:
})
else:
self._update_noise_floor(sess, rms)
# No-Speech-Timeout: wurde die GANZE Zeit KEINE Stimme erkannt
# (last_voice_at==0), feuert der normale Endpoint unten NIE — der braucht
# last_voice_at>0. Ohne das bleibt ein reines Stille-Fenster offen bis
# Hardcap/manuellem Stop → genau Stefans Repro: "die Stille-Ende wird nie
# erreicht, stop ich selbst ist es weg". Nach endpoint_ms Stille ab Start
# schliessen wir das Fenster selbst als no-speech (leer, lautlos, zurueck
# aufs Wake-Word). voiced_frames==0 → _finalize verwirft ohne Transkript,
# also KEIN Phantom.
if sess.last_voice_at == 0 and (now - sess.started_at) * 1000.0 >= sess.endpoint_ms:
await self._finalize(sess, "no_speech")
return
# Endpoint: hat der User schon gesprochen UND ist es seit endpoint_ms still?
if sess.last_voice_at > 0 and (now - sess.last_voice_at) * 1000.0 >= sess.endpoint_ms:
await self._finalize(sess, "endpoint")