feat: Auto-Context im Frontend anzeigen und in DB persistieren

- recalled_context-Header verstärkt (klare Nutzungs-Anweisung statt passivem Hinweis)
- SSE-Event 'auto_context' ans Frontend senden für Live-Anzeige
- Auto-Context als Message (type=auto_context) in DB speichern
- Aufklappbare Auto-Context-Box im Chat-Stream und History-Rendering

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
MelekiandClaude Opus 4.6 committed 2026-04-01 09:28:56 +02:00
1 parent 3f2baa1639
commit 9fe6bed59b
6 files changed
+67 -1

No files matched your search

+22
View File
@@ -103,6 +103,28 @@ function endThinkingBubble() {
_thinkingText = '';
}
// ── Auto-Context Bubble ──
function addAutoContextBubble(contextText) {
if (!contextText) return;
var box = document.createElement('div');
box.className = 'tool-box auto-context-box streamed';
var header = document.createElement('div');
header.className = 'tool-box-header clickable';
header.innerHTML = '<span class="tool-name">Auto-Context</span>';
var content = document.createElement('div');
content.className = 'auto-context-content markdown';
content.hidden = true;
// recalled_context aus XML-Tags extrahieren
var inner = contextText.replace(/<\/?recalled_context>/g, '').trim();
content.innerHTML = renderMarkdown(inner);
header.addEventListener('click', function() { content.hidden = !content.hidden; });
box.appendChild(header);
box.appendChild(content);
chatEl().appendChild(box);
scrollDown();
}
// ── Review Bubbles (Streaming) ──
let _reviewBubble = null;