Skip to content

feat(usage): display provider-defined additional quota limits - #217

Open
Bl0ck154 wants to merge 5 commits into
Lampese:mainfrom
Bl0ck154:contrib/additional-quotas-20261027
Open

Bl0ck154 wants to merge 5 commits into
Lampese:mainfrom
Bl0ck154:contrib/additional-quotas-20261027

Conversation

@Bl0ck154

Copy link
Copy Markdown
Contributor

Why

The usage endpoint can return extra, named quota buckets in additional_rate_limits, such as gpt-reserve. Switcher currently ignores them. For other accounts, the field is missing or null.

Changes

  • Accept missing and null additional limits as an empty list.
  • Parse any named extra quota with a valid usage window, retaining its label, optional model slug, usage percentage, reset timestamp, and availability flags.
  • Ignore malformed entries independently so one unexpected bucket cannot hide the regular usage bars.
  • Render extra named quota bars below the existing five-hour and weekly limits. No hardcoded model names or assumption that GPT Reserve is available on every plan.
  • Keep optional fields compatible with older usage snapshots.

Rust tests exercise null/missing data, multiple independent quotas, invalid entries, and out-of-range usage values. This is an isolated four-file change against upstream main.

CI on the contribution branch: Bl0ck154#10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant