fix(local-llm): lokale Antwort nicht in <voice> wickeln (Anzeige war leer)

Qwen imitierte aus dem Kontext den <voice>-TTS-Block, packte aber die GANZE
Antwort hinein -> Display strippt <voice> -> leere Bubble (nur TTS klang richtig).
Fix: (1) Local-Prompt verbietet <voice>/[FILE:]/<tool_call>/Markup explizit —
nur Plain-Text (wird angezeigt UND vorgelesen). (2) Sicherheitsnetz: Voice-Tags
aus lokalen Antworten strippen, falls das 8B es doch tut.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 13:09:57 +02:00
co-authored by Claude Opus 4.8
parent c3652d2f8e
commit 5b20bc1743
2 changed files with 10 additions and 0 deletions
+6
View File
@@ -1199,6 +1199,12 @@ class Agent:
return None
final = final or "[Lokales LLM: Tool-Loop-Limit erreicht.]"
# Sicherheitsnetz: das lokale Modell wickelt seine Antwort manchmal
# faelschlich komplett in <voice>...</voice> (aus dem Kontext imitiert).
# Das wuerde die Anzeige leeren (Display strippt <voice>). Tags raus —
# der lokale Reply ist kurz, Plain-Text dient Anzeige UND TTS.
final = re.sub(r"</?voice>", "", final).strip()
if local_only:
final = final.replace(router_mod.ESCALATE_MARKER, "").strip()
if not final:
+4
View File
@@ -124,6 +124,10 @@ def build_local_system_prompt(identity_anchor: str, has_tools: bool = False,
"## SCHNELL-MODUS",
"Du laeufst gerade als schnelles lokales Modell fuer Alltags-Konversation "
"und einfache Aufgaben. Antworte knapp, freundlich, auf Deutsch, als ARIA.",
"WICHTIG zur Ausgabe: Antworte in ganz NORMALEM Text. Verwende KEINE "
"`<voice>`-Tags, kein `[FILE:]`, kein `<tool_call>`, kein HTML/Markup — "
"nur ein oder zwei natuerliche Saetze. (Der Text wird direkt angezeigt "
"UND vorgelesen.)",
]
if has_tools:
parts += [