diff --git a/autogpt_platform/backend/backend/api/features/library/db.py b/autogpt_platform/backend/backend/api/features/library/db.py index c614573ab1..2183cb5bef 100644 --- a/autogpt_platform/backend/backend/api/features/library/db.py +++ b/autogpt_platform/backend/backend/api/features/library/db.py @@ -129,9 +129,6 @@ async def list_library_agents( Agents WITH executions come first (sorted by most recent execution), agents WITHOUT executions come last (sorted by creation date). - - Uses updatedAt (not createdAt) because it reflects when the execution - completed or last progressed, showing recently-finished agents first. """ graph = agent.AgentGraph if graph and graph.Executions and len(graph.Executions) > 0: diff --git a/autogpt_platform/backend/backend/data/includes.py b/autogpt_platform/backend/backend/data/includes.py index 9298bf2a75..34cf085a1e 100644 --- a/autogpt_platform/backend/backend/data/includes.py +++ b/autogpt_platform/backend/backend/data/includes.py @@ -119,7 +119,7 @@ def library_agent_include( if include_executions: agent_graph_include["Executions"] = { "where": {"userId": user_id}, - "order_by": {"updatedAt": "desc"}, + "order_by": {"updatedAt": "desc"}, # Uses updatedAt because it reflects when the executioncompleted or last progressed "take": execution_limit, }