tycono 0.3.17 → 0.3.18
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/package.json
CHANGED
|
@@ -95,8 +95,12 @@ class WaveMultiplexer {
|
|
|
95
95
|
const allEvents: { event: ActivityEvent; sessionId: string }[] = [];
|
|
96
96
|
for (const exec of recentSessions) {
|
|
97
97
|
const events = ActivityStream.readFrom(exec.sessionId, 0);
|
|
98
|
-
//
|
|
99
|
-
|
|
98
|
+
// Find last execution boundary (last msg:start) — avoid replaying old executions
|
|
99
|
+
let lastStartIdx = -1;
|
|
100
|
+
for (let i = events.length - 1; i >= 0; i--) {
|
|
101
|
+
if (events[i].type === 'msg:start') { lastStartIdx = i; break; }
|
|
102
|
+
}
|
|
103
|
+
const recent = lastStartIdx >= 0 ? events.slice(lastStartIdx) : events.slice(-50);
|
|
100
104
|
for (const event of recent) {
|
|
101
105
|
allEvents.push({ event, sessionId: exec.sessionId });
|
|
102
106
|
}
|
|
@@ -159,7 +163,12 @@ class WaveMultiplexer {
|
|
|
159
163
|
});
|
|
160
164
|
|
|
161
165
|
const events = ActivityStream.readFrom(execution.sessionId, 0);
|
|
162
|
-
|
|
166
|
+
// Replay only last execution (from last msg:start) — avoid duplicate done events
|
|
167
|
+
let lastStart = -1;
|
|
168
|
+
for (let i = events.length - 1; i >= 0; i--) {
|
|
169
|
+
if (events[i].type === 'msg:start') { lastStart = i; break; }
|
|
170
|
+
}
|
|
171
|
+
const recentEvents = lastStart >= 0 ? events.slice(lastStart) : events.slice(-50);
|
|
163
172
|
for (const event of recentEvents) {
|
|
164
173
|
const key = `${event.roleId}:${event.seq}`;
|
|
165
174
|
if (client.sentEvents.has(key)) continue;
|