mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 07:20:43 +00:00
fix(queue): preserve pending items during drains
This commit is contained in:
@@ -162,7 +162,7 @@ function scheduleAnnounceDrain(key: string) {
|
||||
prompt,
|
||||
internalEvents: internalEvents.length > 0 ? internalEvents : last.internalEvents,
|
||||
});
|
||||
queue.items.splice(0);
|
||||
queue.items.splice(0, items.length);
|
||||
if (summary) {
|
||||
clearQueueSummaryState(queue);
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ export function scheduleFollowupDrain(
|
||||
enqueuedAt: Date.now(),
|
||||
...routing,
|
||||
});
|
||||
queue.items.splice(0);
|
||||
queue.items.splice(0, groupItems.length);
|
||||
if (pendingSummary) {
|
||||
clearQueueSummaryState(queue);
|
||||
pendingSummary = undefined;
|
||||
|
||||
@@ -167,7 +167,7 @@ export function consumeSystemEventEntries(
|
||||
) {
|
||||
return [];
|
||||
}
|
||||
const removed = entry.queue.splice(0).map(cloneSystemEvent);
|
||||
const removed = entry.queue.splice(0, consumedEntries.length).map(cloneSystemEvent);
|
||||
if (entry.queue.length === 0) {
|
||||
entry.lastText = null;
|
||||
entry.lastContextKey = null;
|
||||
|
||||
Reference in New Issue
Block a user