fix: only preempt idle containers when scheduled tasks enqueue

Containers that finish work but stay alive in waitForIpcMessage() block
queued scheduled tasks. Previous approaches killed active containers
mid-work. This fix tracks idle state via the session-update marker
(status: success, result: null) and only preempts when the container
is idle-waiting, not actively working.

Closes #293

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-02-21 21:16:13 +02:00
parent 6f177adafe
commit 93bb94ff55
4 changed files with 145 additions and 0 deletions

View File

@@ -187,6 +187,10 @@ async function processGroupMessages(chatJid: string): Promise<boolean> {
resetIdleTimer();
}
if (!result.result && result.status === 'success') {
queue.notifyIdle(chatJid);
}
if (result.status === 'error') {
hadError = true;
}