Skip to content

Commit ab87ae3

Browse files
committed
chore(router): add sorting of agent id
1 parent a8a50df commit ab87ae3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

openagent/router/routes/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def list_agents(
140140
) -> ResponseModel[dict] | APIExceptionResponse:
141141
try:
142142
total = db.query(Agent).count()
143-
agents = db.query(Agent).offset(page * limit).limit(limit).all()
143+
agents = db.query(Agent).order_by(Agent.id.desc()).offset(page * limit).limit(limit).all()
144144
return ResponseModel(
145145
code=status.HTTP_200_OK,
146146
data=AgentListResponse(

0 commit comments

Comments
 (0)