From c1a92d85205758fe0bb6a5ed9abd411abf5be85e Mon Sep 17 00:00:00 2001 From: Samuel Reed Date: Thu, 5 Mar 2026 11:16:59 -0500 Subject: [PATCH] fix: skip pending_approval agents in heartbeat tickTimers Agents in pending_approval status are not invokable, but tickTimers only skipped paused and terminated agents, causing enqueueWakeup to throw a 409 conflict error on every heartbeat tick for pending_approval agents. Added pending_approval to the skip guard in tickTimers to match the existing guard in enqueueWakeup. --- server/src/services/heartbeat.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/services/heartbeat.ts b/server/src/services/heartbeat.ts index 116431fb..b63b63a4 100644 --- a/server/src/services/heartbeat.ts +++ b/server/src/services/heartbeat.ts @@ -2034,7 +2034,7 @@ export function heartbeatService(db: Db) { let skipped = 0; for (const agent of allAgents) { - if (agent.status === "paused" || agent.status === "terminated") continue; + if (agent.status === "paused" || agent.status === "terminated" || agent.status === "pending_approval") continue; const policy = parseHeartbeatPolicy(agent); if (!policy.enabled || policy.intervalSec <= 0) continue;