feat(fillers): Beruhigungssätze auch im Geräte-TTS-Modus sprechen

Bisher wurde der Filler im "Im Gerät"-Modus (Web Speech API) nur angezeigt,
aber nicht gesprochen (Server-Audio ist dort aus). Jetzt eigener Kanal:

- Orchestrator: chat_stream bekommt on_filler; _emit_filler bevorzugt den
  dedizierten Filler-Kanal (sonst Fallback on_token). Ephemer wie bisher.
- ws.py: on_filler -> {type:"filler", text}.
- Frontend (app.js): {type:"filler"} -> transient in der STATUS-Zeile (nicht
  in der Antwort-Bubble) und im Geräte-Modus sofort speechSynthesis.speak()
  OHNE cancel (mehrere Filler -> Queue; die Antwort cancelt spaeter und
  uebernimmt). Abgesichert ueber deviceVoicesReady()/deviceVoiceReady(lang) —
  keine Verschaerfung der bekannten deviceVoiceReady-Regression.

Server-TTS-Modus unveraendert (Filler zusaetzlich als "Satz null" gesprochen),
zeigt den Filler nun ebenfalls in der Status-Zeile statt in der Bubble.

Tests: 312 gruen; JS-Syntax geprueft. Doc §5.4.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-06-29 23:08:48 +02:00
commit fdf65e8623
4 changed files with 36 additions and 7 deletions

View file

@ -136,6 +136,12 @@ async def _run_turn(
audio_seq += 1
await websocket.send_bytes(chunk)
# Filler (Beruhigungs-/Geduldssätze) als eigener Event: Status-Zeile + Geräte-TTS.
on_filler = None
if stream or audio_stream:
async def on_filler(filler_text):
await websocket.send_json({"type": "filler", "text": filler_text})
try:
if stream or audio_stream:
trace, audio = await orchestrator.chat_stream(
@ -146,6 +152,7 @@ async def _run_turn(
history=llm_context,
on_token=on_token,
on_audio=on_audio,
on_filler=on_filler,
text_only=text_only,
)
else: