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:
parent
ae7446a04b
commit
9b39581b53
|
|
@ -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(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue