feat(diagnostic): RVS-Debug-Logs fuer Whisper- und F5TTS-Bridge

Stefan's Gamebox ist Windows (kein SSH-Zugriff), und in Zukunft
koennten whisper/f5tts auf separaten Hosts laufen. Wir brauchen
deshalb einen Logging-Pfad ueber RVS — gleicher Mechanismus wie
fuer die App (reportAppDebug).

Beide Bridges senden jetzt app_log-Messages mit platform="whisper"
bzw. "f5tts". aria-bridge schreibt sie in /shared/logs/app.log
(unverändert), Live-Logs-Tab + Diagnostic /api/app-log lesen mit.

Toggle via aria-bridge config:
  whisperDebugLog: bool   — default OFF (aktuell aber ON in
                            whisper-bridge weil wir Phase-1/2-
                            Pipeline einfahren)
  f5ttsDebugLog:   bool   — default OFF

Beide werden in voice_config.json persistiert + nach RVS-Connect
rebroadcastet, damit Toggle Container-Restart ueberlebt.

Whisper-Bridge logt aktuell:
  boot                  → Streaming-Mode-Marker (sehen wir damit ob
                          neue Version aktiv ist)
  stream.start          → stt_stream_start angekommen
  stream.chunk          → alle 25 Chunks (=5s Audio) einer
  stream.chunk.reject   → Chunk fuer unbekannte Session
  stream.partial        → Whisper hat neuen Text erkannt
  stream.final          → Endpoint detected, finaler Text raus
  stream.end            → stt_stream_end angekommen
  config                → Toggle umgeschaltet

F5TTS-Helper ist da (gleicher Pattern), Logging-Punkte kommen
spaeter wenn wir ein konkretes TTS-Problem zu debuggen haben.
This commit is contained in:
2026-05-30 22:00:55 +02:00
parent a68827fb38
commit 493cba36a2
3 changed files with 166 additions and 0 deletions
+59
View File
@@ -375,6 +375,41 @@ async def _send(ws, mtype: str, payload: dict) -> None:
logger.warning("Send fehlgeschlagen (%s): %s", mtype, e)
# ──────────────────────────────────────────────────────────────
# DEBUG-LOG ueber RVS → /shared/logs/app.log
#
# Gleiches Pattern wie in whisper-bridge: Stefan's Gamebox ist
# Windows (kein SSH), in Zukunft koennten whisper + f5tts auf
# unterschiedlichen Hosts laufen. Logs ueber RVS heisst: ein Pfad.
#
# Toggle via aria-bridge config broadcast: f5ttsDebugLog (bool).
# ──────────────────────────────────────────────────────────────
_DEBUG_LOG_TO_BRIDGE: bool = False # default OFF — TTS-Renders sind teurer
# zu debuggen, normalerweise nicht noetig
async def _debug_log(ws, scope: str, message: str, level: str = "info") -> None:
"""Schickt einen app_log via RVS → /shared/logs/app.log mit platform='f5tts'.
No-op wenn Toggle aus."""
if not _DEBUG_LOG_TO_BRIDGE:
return
try:
await ws.send(json.dumps({
"type": "app_log",
"payload": {
"ts": int(time.time() * 1000),
"platform": "f5tts",
"level": level,
"scope": scope,
"message": str(message)[:2000],
"stack": "",
},
"timestamp": int(time.time() * 1000),
}))
except Exception:
pass
# ── Interne Transkription via whisper-bridge ────────────────
_pending_stt: dict[str, asyncio.Future] = {}
@@ -867,6 +902,30 @@ async def run_loop(runner: F5Runner) -> None:
else:
fut.set_result(payload.get("text") or "")
elif mtype == "config":
# Debug-Toggle (gleiche Semantik wie in whisper-bridge)
if "f5ttsDebugLog" in payload:
global _DEBUG_LOG_TO_BRIDGE
old = _DEBUG_LOG_TO_BRIDGE
_DEBUG_LOG_TO_BRIDGE = bool(payload.get("f5ttsDebugLog", False))
if old != _DEBUG_LOG_TO_BRIDGE:
logger.info("Debug-Log-to-Bridge: %s", "ON" if _DEBUG_LOG_TO_BRIDGE else "OFF")
# Last gasp wenn ausgeschaltet wird
if not _DEBUG_LOG_TO_BRIDGE:
try:
await ws.send(json.dumps({
"type": "app_log",
"payload": {
"ts": int(time.time() * 1000),
"platform": "f5tts",
"level": "info",
"scope": "config",
"message": "debug-log OFF (toggle aus)",
"stack": "",
},
"timestamp": int(time.time() * 1000),
}))
except Exception:
pass
# F5-TTS-Settings aktualisieren (Modell, cfg_strength, nfe)
async def _update_with_status(p):
# Schaut ob ein Modell-Wechsel ansteht — falls ja: