fix(proxy): break top api_key ties deterministically

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
jesus 2026-09-12 16:49:50 +00:00
parent 31cedbad81
commit 9f25236425

View file

@ -720,7 +720,7 @@ def _build_aggregated_sql_query(
FROM "{pg_table}"
WHERE {where_clause}
GROUP BY api_key
ORDER BY SUM(spend) DESC
ORDER BY SUM(spend) DESC, api_key
LIMIT {_MAX_API_KEYS_IN_BREAKDOWN}
)
SELECT