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