fix format using poetry

This commit is contained in:
Medyan
2026-01-31 16:55:38 -05:00
parent 3a38bb2338
commit 9688a507a3
2 changed files with 18 additions and 5 deletions

View File

@@ -368,7 +368,12 @@ async def test_list_library_agents_sort_by_last_executed(mocker):
)
# Return agents in random order to verify sorting works
mock_library_agents = [library_agent3, library_agent1, library_agent4, library_agent2]
mock_library_agents = [
library_agent3,
library_agent1,
library_agent4,
library_agent2,
]
# Mock prisma calls
mock_agent_graph = mocker.patch("prisma.models.AgentGraph.prisma")
@@ -391,7 +396,13 @@ async def test_list_library_agents_sort_by_last_executed(mocker):
# 3. Agent 3 (no executions, created 1 day ago) - newer creation
# 4. Agent 4 (no executions, created 2 days ago) - older creation
assert len(result.agents) == 4
assert result.agents[0].id == "lib1", "Agent with most recent execution should be first"
assert (
result.agents[0].id == "lib1"
), "Agent with most recent execution should be first"
assert result.agents[1].id == "lib2", "Agent with older execution should be second"
assert result.agents[2].id == "lib3", "Agent without executions (newer) should be third"
assert result.agents[3].id == "lib4", "Agent without executions (older) should be last"
assert (
result.agents[2].id == "lib3"
), "Agent without executions (newer) should be third"
assert (
result.agents[3].id == "lib4"
), "Agent without executions (older) should be last"

View File

@@ -119,7 +119,9 @@ def library_agent_include(
if include_executions:
agent_graph_include["Executions"] = {
"where": {"userId": user_id},
"order_by": {"updatedAt": "desc"}, # Uses updatedAt because it reflects when the executioncompleted or last progressed
"order_by": {
"updatedAt": "desc"
}, # Uses updatedAt because it reflects when the executioncompleted or last progressed
"take": execution_limit,
}