From efe07486e27a0e933a39a4581c41d55cfd321e0e Mon Sep 17 00:00:00 2001 From: Johannes du Plessis Date: Wed, 17 Jun 2026 10:59:42 -0700 Subject: [PATCH] feat: weight merged PRs above LOC in usage leaderboard sorting (#1563) Move merged_prs to the primary sort key in the agent usage leaderboard, ahead of agent_loc, prs_opened, and agent_runs. Update the UI description to reflect the new ranking order. Co-authored-by: open-swe[bot] --- agent/dashboard/agent_usage.py | 1 + ui/src/routes/usage.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agent/dashboard/agent_usage.py b/agent/dashboard/agent_usage.py index a53ddd7e..f3a305c7 100644 --- a/agent/dashboard/agent_usage.py +++ b/agent/dashboard/agent_usage.py @@ -398,6 +398,7 @@ async def _build_usage_leaderboard_snapshot(period: Period) -> dict[str, Any]: sorted_users = sorted( users.values(), key=lambda item: ( + -item["merged_prs"], -item["agent_loc"], -item["prs_opened"], -item["agent_runs"], diff --git a/ui/src/routes/usage.tsx b/ui/src/routes/usage.tsx index bb93e3b6..0574a846 100644 --- a/ui/src/routes/usage.tsx +++ b/ui/src/routes/usage.tsx @@ -63,7 +63,7 @@ function UsagePage() {