providers_search: ties sort by name A→Z

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FAqjv1sLfUad2bMcsmPbRT
This commit is contained in:
teahubxyzandClaude Fable 5.1 committed 2026-10-29 00:46:30 +00:00
1 parent 9ccbf48bdf
commit 5bec2c0f37
1 file changed
+2 -1
+2 -1
View File
@@ -93,7 +93,8 @@ def oracle_search(query: str, limit: int = 10, connectable_only: bool = True) ->
1 if "teahub" in row["sources"] else 0,
)
hits.append((score, row))
hits.sort(key=lambda item: (item[0], item[1]["name"].lower()), reverse=True)
hits.sort(key=lambda item: item[1]["name"].lower())
hits.sort(key=lambda item: item[0], reverse=True)
return [row for _, row in hits[: max(1, min(limit, 50))]]