Skip to content

Commit 154dce5

Browse files
committed
fix(quota-stats): show providers with quota data even if zero requests
Previously, providers were hidden from the TUI if they had 0 total_requests. This meant quota-tracked providers like Lightning AI would never appear until a request was made through them. Now providers are included if they have either: - Any requests (existing behaviour) - Any quota group with a populated limit (new: shows quota-only providers)
1 parent 84215e2 commit 154dce5

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/rotator_library/client/rotating_client.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,17 @@ async def get_quota_stats(
524524

525525
stats = await manager.get_stats_for_endpoint()
526526

527-
# Skip providers with no activity (filters out invalid/unused providers)
528-
if stats.get("total_requests", 0) == 0:
527+
# Skip providers with no activity AND no quota data
528+
# (filters out invalid/unused providers, but keeps quota-tracked providers visible)
529+
has_requests = stats.get("total_requests", 0) > 0
530+
has_quota_data = any(
531+
any(
532+
ws.get("total_max", 0) > 0
533+
for ws in group_stats.get("windows", {}).values()
534+
)
535+
for group_stats in stats.get("quota_groups", {}).values()
536+
)
537+
if not has_requests and not has_quota_data:
529538
continue
530539

531540
providers[provider] = stats

0 commit comments

Comments
 (0)