From a689a18dfaec38cba3dd8ba00476be37d578de30 Mon Sep 17 00:00:00 2001 From: glifocat Date: Sun, 8 Mar 2026 20:43:21 +0100 Subject: [PATCH] fix: close task container promptly when agent uses IPC-only messaging (#840) Scheduled tasks that send messages via send_message (IPC) instead of returning text as result left the container idle for ~30 minutes until the hard timeout killed it (exit 137). This blocked new messages for the group during that window. Root cause: scheduleClose() was only called inside the `if (streamedOutput.result)` branch. Tasks that communicate solely through IPC (e.g. heartbeat check-ins) complete with result=null, so the 10s close timer was never set. Fix: also call scheduleClose() on status==='success', covering both result-based and IPC-only task completions. Co-authored-by: Claude Opus 4.6 --- src/task-scheduler.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/task-scheduler.ts b/src/task-scheduler.ts index f216e12..d0abd2e 100644 --- a/src/task-scheduler.ts +++ b/src/task-scheduler.ts @@ -191,6 +191,7 @@ async function runTask( } if (streamedOutput.status === 'success') { deps.queue.notifyIdle(task.chat_jid); + scheduleClose(); // Close promptly even when result is null (e.g. IPC-only tasks) } if (streamedOutput.status === 'error') { error = streamedOutput.error || 'Unknown error';