mirror of
https://github.com/pewdiepie-archdaemon/odysseus.git
synced 2026-07-12 12:37:32 +00:00
fix(stabilization): harden attachment lifecycle and agent guard signals (#5420)
* fix: harden stabilization attachment and agent guards * fix(uploads): preserve durable references during cleanup * fix(uploads): close cleanup and compaction races
This commit is contained in:
+17
-1
@@ -1822,7 +1822,7 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer
|
||||
typewriterInto(roundHolder.querySelector('.body'), errMsg);
|
||||
break;
|
||||
}
|
||||
if (json.delta || json.type === 'agent_prep' || json.type === 'tool_start' || json.type === 'tool_output' || json.type === 'tool_progress' || json.type === 'agent_step' || json.type === 'doc_stream_open' || json.type === 'doc_stream_delta' || json.type === 'research_progress') {
|
||||
if (json.delta || json.type === 'agent_prep' || json.type === 'tool_start' || json.type === 'tool_output' || json.type === 'tool_progress' || json.type === 'agent_step' || json.type === 'loop_breaker_triggered' || json.type === 'intent_nudge_exhausted' || json.type === 'doc_stream_open' || json.type === 'doc_stream_delta' || json.type === 'research_progress') {
|
||||
clearResponseTimeout();
|
||||
clearProcessingProbe();
|
||||
clearFirstTokenWaitTimers();
|
||||
@@ -2852,6 +2852,22 @@ import { wireArrowUpRecall, getLastUserMessageFromChatHistory } from './composer
|
||||
const chatBox = document.getElementById('chat-history');
|
||||
chatBox.appendChild(budgetDiv);
|
||||
|
||||
} else if (json.type === 'loop_breaker_triggered' || json.type === 'intent_nudge_exhausted') {
|
||||
if (_isBg) continue;
|
||||
_cancelThinkingTimer();
|
||||
_removeThinkingSpinner();
|
||||
const guardDiv = document.createElement('div');
|
||||
guardDiv.className = 'stopped-indicator';
|
||||
const guardLabel = document.createElement('span');
|
||||
guardLabel.textContent = `[Agent guard: ${json.message || json.reason || 'internal stop'}]`;
|
||||
guardDiv.appendChild(guardLabel);
|
||||
const targetBody = roundHolder && roundHolder.querySelector('.body');
|
||||
if (targetBody) targetBody.appendChild(guardDiv);
|
||||
else {
|
||||
const chatBox = document.getElementById('chat-history');
|
||||
if (chatBox) chatBox.appendChild(guardDiv);
|
||||
}
|
||||
|
||||
} else if (json.type === 'teacher_takeover') {
|
||||
if (_isBg) continue;
|
||||
_cancelThinkingTimer();
|
||||
|
||||
Reference in New Issue
Block a user