Spaces:
Running
Running
Update backend/agents/operations_agent.py
#5
by
munals - opened
backend/agents/operations_agent.py
CHANGED
|
@@ -32,6 +32,7 @@ class OperationsAgent:
|
|
| 32 |
self.name = 'OperationsAgent'
|
| 33 |
self.aisa_layer = 'Execution (Decision)'
|
| 34 |
self.db = db
|
|
|
|
| 35 |
print('π¨ [OperationsAgent] Ready β event-driven | actions decided by CoordinatorAgent (LLM)')
|
| 36 |
|
| 37 |
# ββ Private helpers βββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -60,6 +61,9 @@ class OperationsAgent:
|
|
| 60 |
return False
|
| 61 |
last = self.db.get_last_p0_time(context)
|
| 62 |
if last:
|
|
|
|
|
|
|
|
|
|
| 63 |
delta = datetime.now() - last
|
| 64 |
if delta.total_seconds() < self.RATE_LIMIT_SEC:
|
| 65 |
print(
|
|
|
|
| 32 |
self.name = 'OperationsAgent'
|
| 33 |
self.aisa_layer = 'Execution (Decision)'
|
| 34 |
self.db = db
|
| 35 |
+
self._boot_time = datetime.now()
|
| 36 |
print('π¨ [OperationsAgent] Ready β event-driven | actions decided by CoordinatorAgent (LLM)')
|
| 37 |
|
| 38 |
# ββ Private helpers βββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 61 |
return False
|
| 62 |
last = self.db.get_last_p0_time(context)
|
| 63 |
if last:
|
| 64 |
+
# Ignore stale P0 records from previous runs; rate-limit only within current process lifetime.
|
| 65 |
+
if last < self._boot_time:
|
| 66 |
+
return False
|
| 67 |
delta = datetime.now() - last
|
| 68 |
if delta.total_seconds() < self.RATE_LIMIT_SEC:
|
| 69 |
print(
|