fix: auto-assign tasks to PM agent when moved to in_progress, fix datetime serialization in WebSocket, add executor logging
Deploy Dashboard (Dev) / deploy-dev (push) Failing after 2m19s
Run Tests / Frontend Tests (push) Has been cancelled
Run Tests / Backend Tests (push) Has started running
Run Tests / Test Summary (push) Has been cancelled

This commit is contained in:
Gan, Jimmy
2026-04-02 10:22:15 +08:00
parent 21d0cd9ff6
commit 2c8f4fcd5c
3 changed files with 43 additions and 4 deletions
@@ -43,13 +43,18 @@ class AgentExecutor:
async def start(self):
"""Start the executor service"""
self.running = True
print("=== Agent Executor Loop Started ===")
logger.info("Agent executor service started")
while self.running:
try:
print(f"[Executor] Checking for pending executions... (running={self.running})")
await self._process_pending_executions()
except Exception as e:
print(f"[Executor] Error in executor loop: {e}")
logger.error(f"Error in executor loop: {e}")
import traceback
traceback.print_exc()
await asyncio.sleep(5) # Check every 5 seconds
@@ -61,11 +66,14 @@ class AgentExecutor:
async def _process_pending_executions(self):
"""Process pending agent executions"""
executions = await opc_db.get_agent_executions(status="pending", limit=10)
print(f"[Executor] Found {len(executions)} pending executions")
for execution in executions:
try:
print(f"[Executor] Processing execution {execution['id']} for agent {execution['agent_id']}")
await self._execute_agent(execution)
except Exception as e:
print(f"[Executor] Failed to execute agent {execution['agent_id']}: {e}")
logger.error(f"Failed to execute agent {execution['agent_id']}: {e}")
await self._mark_execution_failed(execution["id"], str(e))