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 <noreply@anthropic.com>
This commit is contained in:
oskar 2026-05-21 17:47:37 +02:00
parent ae7446a04b
commit 9b39581b53

View file

@ -103,12 +103,13 @@ class Supervisor:
self._generate_recommendation(drift) self._generate_recommendation(drift)
def _generate_recommendation(self, drift): def _generate_recommendation(self, drift):
action_id = f"reconcile-{int(time.time())}-{drift['node']}-{drift['service']}" action_id = f"reconcile-{drift['node']}-{drift['service']}"
action_path = ACTIONS_DIR / "pending" / f"{action_id}.json" # Check all active states so we don't recreate after approval/execution
for state in ("pending", "approved", "running"):
if action_path.exists(): if (ACTIONS_DIR / state / f"{action_id}.json").exists():
return # Already recommended return
action_path = ACTIONS_DIR / "pending" / f"{action_id}.json"
action = { action = {
"action_id": action_id, "action_id": action_id,
"timestamp": time.time(), "timestamp": time.time(),