feat(quotas): provider-grouped widget + credential gating + extra_provider_ids#216
Merged
typelicious merged 1 commit intomainfrom Apr 18, 2026
Merged
Conversation
Reworks the /api/quotas surface so the dashboard widget matches how CodexBar presents provider state: - QuotaStatus gains a provider_group field; the widget groups packages under one provider card and subdivides by package inside it - daily / rolling_window statuses accept extra_provider_ids so a shared quota (e.g. Google AI Studio free tier covers both gemini-flash and gemini-flash-lite) is counted across all router IDs that draw from it - /api/quotas applies a credential gate: packages tagged with _requires_credential are hidden when the env var is missing / placeholder, or when the OAuth subject is not in the local token store. Skipped entries are reported back under skipped_packages so operators can see what's dormant and why. - dashboard widget renders one card per provider_group with all its packages stacked (CodexBar-style), plus a small "hidden" callout listing credential-gated packages that aren't active yet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Addresses the feedback that the quotas widget shows nonsense for providers without credentials and fails to group shared quotas (e.g. Gemini Flash + Flash-Lite).
What changes
QuotaStatusgains aprovider_groupfield — dashboard groups packages under one provider card (CodexBar-style), subdivided by package inside. Fallback derivation when the catalog omits the field.extra_provider_idssupport — rolling_window + daily status computations sum local counts across every listed router provider ID, so shared subscriptions/free tiers read accurately./api/quotas— packages tagged with_requires_credentialare hidden when the env var is missing / carries ayour-keyplaceholder, or when the OAuth subject isn't in the local token store. Skipped packages are reported underskipped_packagesso the UI can show what's dormant and why.provider_group, packages stacked inside, plus a compact "hidden" callout at the bottom listing credential-gated entries.Companion catalog change
The accompanying
fusionaize-metadatacatalog update (local, not committed — carries real credit balances) introduces these tags. Gate tolerates catalogs that omit them: packages without_requires_credentialpass through unchanged, andprovider_groupfalls back to a family-prefix heuristic.Verified
Test plan
_filter_packages_by_credentialsagainst real env + tokens.json/dashboard/quotas— cards should group by provider, weekly Claude Pro + 5h session should show together, Gemini should be a single card covering both flash variants, OpenRouter flips between "hidden" and active based on env.🤖 Generated with Claude Code