From 9b39581b53c47afdafd2a29f4b33ea9a18dab275 Mon Sep 17 00:00:00 2001 From: oskar Date: Thu, 21 May 2026 17:47:37 +0200 Subject: [PATCH] fix(supervisor): content-based action IDs to prevent 30s backlog accumulation Timestamp in reconcile-{ts}-{node}-{service} meant dedup guard never fired. Switch to reconcile-{node}-{service} and check pending/approved/running states. Co-Authored-By: Claude Sonnet 4.6 --- services/control-plane/src/supervisor.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/services/control-plane/src/supervisor.py b/services/control-plane/src/supervisor.py index 3b229eb..3ec151a 100644 --- a/services/control-plane/src/supervisor.py +++ b/services/control-plane/src/supervisor.py @@ -103,12 +103,13 @@ class Supervisor: self._generate_recommendation(drift) def _generate_recommendation(self, drift): - action_id = f"reconcile-{int(time.time())}-{drift['node']}-{drift['service']}" - action_path = ACTIONS_DIR / "pending" / f"{action_id}.json" - - if action_path.exists(): - return # Already recommended + action_id = f"reconcile-{drift['node']}-{drift['service']}" + # Check all active states so we don't recreate after approval/execution + for state in ("pending", "approved", "running"): + if (ACTIONS_DIR / state / f"{action_id}.json").exists(): + return + action_path = ACTIONS_DIR / "pending" / f"{action_id}.json" action = { "action_id": action_id, "timestamp": time.time(),