fix(diagnostic): [FILE: ...]-Marker-Filter ueberall (in addChat statt nur chat_final)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -998,12 +998,7 @@
|
||||
}
|
||||
|
||||
if (msg.type === 'chat_final') {
|
||||
// [FILE: /shared/uploads/aria_xxx.ext]-Marker aus dem Antworttext
|
||||
// entfernen — die Datei kommt separat via file_from_aria.
|
||||
// (Diagnostic empfaengt chat_final direkt vom Gateway, Bridge
|
||||
// hat darum nicht filtern koennen.)
|
||||
const cleaned = (msg.text || '').replace(/\[FILE:\s*\/shared\/uploads\/[^\]]+\]/gi, '').replace(/\n{3,}/g, '\n\n').trim();
|
||||
addChat('received', cleaned, 'chat:final');
|
||||
addChat('received', msg.text || '', 'chat:final');
|
||||
return;
|
||||
}
|
||||
if (msg.type === 'file_from_aria') {
|
||||
@@ -1449,6 +1444,10 @@
|
||||
}
|
||||
|
||||
function addChat(type, text, meta, options) {
|
||||
// [FILE: /shared/uploads/aria_xxx.ext]-Marker aus dem Antworttext entfernen —
|
||||
// die Datei kommt separat via file_from_aria-Event als eigene Bubble.
|
||||
// /gi entfernt mehrere Marker, falls ARIA mehrere Dateien in einer Antwort liefert.
|
||||
if (text) text = text.replace(/\[FILE:\s*\/shared\/uploads\/[^\]]+\]/gi, '').replace(/\n{3,}/g, '\n\n').trim();
|
||||
const escaped = escapeHtml(text);
|
||||
let linked = linkifyText(escaped);
|
||||
// /shared/uploads/ Pfade als Inline-Bilder anzeigen
|
||||
|
||||
Reference in New Issue
Block a user