feat(diagnostic): Quell-Badge an ARIA-Bubbles (local / claude / fast-path)

Zeigt pro Antwort, welcher Backend sie erzeugt hat — farbcodiert (lokal=gruen,
Claude=blau, Fast-Path=lila). Nur in Diagnostic (App bleibt Mama-tauglich).

- agent.chat() gibt jetzt (reply, answered_by) zurueck; an jedem Return-Punkt
  gesetzt (fast-path/local/claude). Beide Aufrufer (main.py, background.py)
  angepasst. main.py: ChatOut.answered_by.
- bridge: liest answered_by aus /chat, reicht es an _process_core_response,
  broadcastet es im chat-Payload UND persistiert es in chat_backup (answeredBy)
  → bleibt nach Reload.
- diagnostic: srcBadgeHtml() rendert den Badge in Live-Chat + History;
  server.js liefert answeredBy in der chat_history.

Erweiterbar: spaeter kann ein Bild-Backend (FLUX/Modellname) denselben Kanal
nutzen. Modellwechsel-fuer-Antworten (groessere Modelle bei mehr GPUs) bleibt
B0.5/Skalierungs-Thema im Plan.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 13:40:36 +02:00
co-authored by Claude Opus 4.8
parent 53c098a9c8
commit 9cc1aec5ec
6 changed files with 39 additions and 10 deletions
+2 -1
View File
@@ -2816,6 +2816,7 @@ async function handleLoadChatHistory(clientWs) {
const ts = obj.ts || 0;
const text = String(obj.text || "");
const projectId = String(obj.project_id || ""); // Multi-Threading: Kontext-Zuordnung
const answeredBy = String(obj.answeredBy || ""); // Quell-Badge (local/claude/fast-path)
if (obj.role === "user") {
if (text) messages.push({ type: "sent", text, meta: "Gateway direkt", ts, projectId });
continue;
@@ -2842,7 +2843,7 @@ async function handleLoadChatHistory(clientWs) {
projectId,
});
}
if (text) messages.push({ type: "received", text, meta: "chat:final", ts, projectId });
if (text) messages.push({ type: "received", text, meta: "chat:final", ts, projectId, answeredBy });
}
clientWs.send(JSON.stringify({ type: "chat_history", messages }));