fix(chat): Web-Search-Streaming – Text-Bubbles nach Search in gleicher Bubble fortsetzen
- chat.js: _afterWebSearch Flag trackt ob gerade eine Web-Search beendet wurde - text_start nach Web-Search: resumeStreamBubble() statt neue Bubble - web_search_start: Bubble NICHT beenden (bleibt finalisiert im DOM) - web_search_end: setzt _afterWebSearch=true - Flag wird bei tool_start, review_start, finalizer_start, error, done zurückgesetzt - ui.js: Neue resumeStreamBubble() Funktion - _lastStreamDiv/_lastStreamText speichern letzte finalisierte Bubble - resumeStreamBubble() reaktiviert die letzte Bubble zum Weiter-Streamen - Verhindert separate Message-Blöcke bei mehrfachen Web-Searches
This commit is contained in:
1 parent
4bec740765
commit
116f21105c
2 files changed
+34
-3
No files matched your search
@@ -749,12 +749,16 @@ function finalizeReviewBubble(type, data, agentType) {
|
||||
|
||||
let _streamDiv = null;
|
||||
let _streamText = '';
|
||||
let _lastStreamDiv = null;
|
||||
let _lastStreamText = '';
|
||||
|
||||
function startStreamBubble() {
|
||||
_streamDiv = document.createElement('div');
|
||||
_streamDiv.className = 'msg assistant markdown streamed';
|
||||
_streamDiv.innerHTML = '<p><span class="cursor"></span></p>';
|
||||
_streamText = '';
|
||||
_lastStreamDiv = null;
|
||||
_lastStreamText = '';
|
||||
chatEl().appendChild(_streamDiv);
|
||||
scrollDown();
|
||||
}
|
||||
@@ -786,10 +790,24 @@ function endStreamBubble() {
|
||||
wrapKreaGalleries(_streamDiv);
|
||||
}
|
||||
}
|
||||
_lastStreamDiv = _streamDiv;
|
||||
_lastStreamText = _streamText;
|
||||
_streamDiv = null;
|
||||
_streamText = '';
|
||||
}
|
||||
|
||||
function resumeStreamBubble() {
|
||||
// Letzte finalisierte Bubble wiederverwenden (z.B. nach Web-Search)
|
||||
if (_lastStreamDiv && _lastStreamDiv.parentNode) {
|
||||
_streamDiv = _lastStreamDiv;
|
||||
_streamText = _lastStreamText;
|
||||
} else {
|
||||
startStreamBubble();
|
||||
}
|
||||
_lastStreamDiv = null;
|
||||
_lastStreamText = '';
|
||||
}
|
||||
|
||||
// ── Tool Call Visibility ──
|
||||
|
||||
const MODIFICATION_TOOLS = ['write_file', 'edit_file', 'delete_file', 'memory_write'];
|
||||
|
||||
Reference in new issue
Block a user