feat(archivar): Telemetrie um STAY/UNSICHER/TIMEOUT-Unterscheidung erweitern

Auftrag t_5e4863c6 — Routing-Telemetrie differenziert jetzt:
- llm_stay_sicher  — LLM sagte STAY (sicher), kein Red Flag, kein Cloud-Call
- llm_unsicher     — LLM sagte UNSICHER, Red Flag (Cloud-Call)
- llm_timeout      — LLM timeoutete (separat von llm_unavailable)
- cloud_call_stay  — Cloud-Agent endete mit STAY (Cloud-Call ohne Routing-Effekt)
- cloud_call_route — Cloud-Agent entschied ROUTE (Cloud-Call mit Wirkung)
- no_llm_needed    — Nachricht vor Stufe 4 entschieden (FAISS/Keyword/Smalltalk)

Abwärtskompatibel: llm_stay und llm_unavailable bleiben unverändert.
::status zeigt die neuen Zähler in einer Routing-Telemetrie-Sektion.
10 neue Tests (test_telemetry_stay_unsicher_timeout.py).
This commit is contained in:
Bernd (Hermes)
2026-09-02 15:36:05 +02:00
parent 21b1fd4e13
commit 00aecfaa7b
5 changed files with 355 additions and 2 deletions
+27
View File
@@ -520,6 +520,7 @@ def build_status_text(
current_status: str = "online",
pulse_active: bool = False,
plugin_version: str = "",
routing_counts: Optional[Dict[str, int]] = None,
) -> str:
"""Baut die Status-Seite mit aktuellen Plugin-Informationen.
@@ -533,6 +534,9 @@ def build_status_text(
current_status: Aktueller Presence-Status ('online', 'away', 'busy').
pulse_active: Ob der PulseController gerade pulsiert.
plugin_version: Plugin-Version (z.B. "9.2 (1d31d2c)").
routing_counts: Routing-Counter-Dict (aus routing_counter.get_counts()).
Wenn gesetzt, wird eine STAY/UNSICHER/TIMEOUT-Telemetrie-Sektion
angezeigt (Auftrag t_5e4863c6).
Returns:
Formatierte Status-Seite.
@@ -579,6 +583,29 @@ def build_status_text(
lines.append("")
lines.append(room_map_summary)
# ── Routing-Telemetrie (STAY/UNSICHER/TIMEOUT, Auftrag t_5e4863c6) ──
if routing_counts:
lines.append("")
lines.append("**Routing-Telemetrie (seit Gateway-Start):**")
lines.append(
f"- **LLM STAY (sicher):** {routing_counts.get('llm_stay_sicher', 0)}"
)
lines.append(
f"- **LLM UNSICHER:** {routing_counts.get('llm_unsicher', 0)}"
)
lines.append(
f"- **LLM Timeout:** {routing_counts.get('llm_timeout', 0)}"
)
lines.append(
f"- **Cloud-Call → STAY:** {routing_counts.get('cloud_call_stay', 0)}"
)
lines.append(
f"- **Cloud-Call → ROUTE:** {routing_counts.get('cloud_call_route', 0)}"
)
lines.append(
f"- **Ohne LLM entschieden:** {routing_counts.get('no_llm_needed', 0)}"
)
lines.append("")
lines.append("💡 `::hilfe` für alle Befehle | `::status` für Aktualisierung")