@yemi33/minions 0.1.70 → 0.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/dashboard/js/live-stream.js +3 -24
- package/dashboard/js/refresh.js +2 -16
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -82,30 +82,9 @@ function startLiveStream(agentId) {
|
|
|
82
82
|
const msgEl = document.getElementById('live-messages');
|
|
83
83
|
if (msgEl) msgEl.innerHTML = '';
|
|
84
84
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
try {
|
|
89
|
-
const chunk = JSON.parse(e.data);
|
|
90
|
-
renderLiveChatMessage(chunk);
|
|
91
|
-
} catch (e) { console.error('live-stream:', e.message); }
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
liveEventSource.addEventListener('done', function() {
|
|
95
|
-
stopLiveStream();
|
|
96
|
-
const steerBar = document.getElementById('live-steer-bar');
|
|
97
|
-
if (steerBar) steerBar.style.display = 'none';
|
|
98
|
-
const statusLabel = document.getElementById('live-status-label');
|
|
99
|
-
if (statusLabel) { statusLabel.textContent = 'Completed'; statusLabel.style.color = 'var(--muted)'; }
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
liveEventSource.onerror = function() {
|
|
103
|
-
// Fall back to polling on SSE error
|
|
104
|
-
stopLiveStream();
|
|
105
|
-
startLivePolling();
|
|
106
|
-
const label = document.getElementById('live-status-label');
|
|
107
|
-
if (label) label.textContent = 'Auto-refreshing every 3s';
|
|
108
|
-
};
|
|
85
|
+
// Use polling instead of SSE to avoid HTTP/1.1 connection exhaustion
|
|
86
|
+
// (SSE holds a persistent connection, blocking CC and other API calls)
|
|
87
|
+
startLivePolling();
|
|
109
88
|
}
|
|
110
89
|
|
|
111
90
|
function stopLiveStream() {
|
package/dashboard/js/refresh.js
CHANGED
|
@@ -57,22 +57,8 @@ async function refresh() {
|
|
|
57
57
|
|
|
58
58
|
refresh();
|
|
59
59
|
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
let _statusStream = null;
|
|
63
|
-
try {
|
|
64
|
-
_statusStream = new EventSource('/api/status-stream');
|
|
65
|
-
_statusStream.onmessage = (e) => {
|
|
66
|
-
try { _processStatusUpdate(JSON.parse(e.data)); } catch (e2) { console.error('status-stream:', e2.message); }
|
|
67
|
-
};
|
|
68
|
-
_statusStream.addEventListener('reload', () => { location.reload(); });
|
|
69
|
-
_statusStream.onerror = () => {
|
|
70
|
-
if (_statusStream) { _statusStream.close(); _statusStream = null; }
|
|
71
|
-
setInterval(refresh, 4000);
|
|
72
|
-
};
|
|
73
|
-
} catch {
|
|
74
|
-
setInterval(refresh, 4000);
|
|
75
|
-
}
|
|
60
|
+
// Poll for status updates (SSE caused HTTP/1.1 connection exhaustion — CC fetch would fail)
|
|
61
|
+
setInterval(refresh, 4000);
|
|
76
62
|
|
|
77
63
|
// Wire sidebar navigation
|
|
78
64
|
document.querySelectorAll('.sidebar-link').forEach(link => {
|
package/package.json
CHANGED