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.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user