Fix agent listing and add scheduler timing tests

This commit is contained in:
2025-11-02 00:07:55 -06:00
parent c64b224750
commit 207460e941
4 changed files with 127 additions and 1 deletions

View File

@@ -615,7 +615,11 @@ class DeviceManagementService:
payload["agent_id"] = agent_key
agents[agent_key] = payload
return {"agents": agents}, 200
# The legacy server exposed /api/agents as a mapping keyed by
# agent identifier. The Engine WebUI expects the same structure,
# so we return the flattened dictionary directly instead of
# wrapping it in another object.
return agents, 200
except Exception as exc:
self.logger.debug("Failed to list agents", exc_info=True)
return {"error": str(exc)}, 500