Skip to content

feat(google-agy): migrate to retrieveUserQuotaSummary API#144

Open
anthonyhaussman wants to merge 1 commit into
slkiser:mainfrom
anthonyhaussman:tone/feat/agy_quota_summary_weekly
Open

feat(google-agy): migrate to retrieveUserQuotaSummary API#144
anthonyhaussman wants to merge 1 commit into
slkiser:mainfrom
anthonyhaussman:tone/feat/agy_quota_summary_weekly

Conversation

@anthonyhaussman

Copy link
Copy Markdown
Contributor

Summary

Following the last release of opencode-agy-auth, switch from per-model retrieveUserQuota to grouped retrieveUserQuotaSummary endpoint.

The new API returns model families (e.g. "Gemini Models", "Claude and GPT models") with weekly/5h buckets, eliminating client-side model name parsing and aggregation.

Add rankOverride/groupSortOverride fields for explicit intra-group and inter-group ordering.
Filter disabled buckets before display.
Merge summary groups across accounts keeping minimum remainingFraction.

New display:

> node dist/bin/opencode-quota.js show --provider google-agy
[Google AGY · Gemini Models]
Weekly window                                   2d
██████████████░░░░░░░░░░░░░░░░░░░░░░░░░   35% left
5h window                                       5h
██████████████████████████████████████░   97% left

[Google AGY · Claude and GPT models]
Weekly window                                   4d
███████████████████████████████░░░░░░░░   79% left
5h window                                         
███████████████████████████████████████  100% left

Linked Issue

Improve the display of opencode-agy Google AntiGravity quota to be in accordance with the Antigravity client.

OpenCode Validation

  • Current production released OpenCode version tested: 1.17.10
  • Why this version is relevant to the fix: -

Quality Checklist

  • I ran pnpm run typecheck
  • I ran pnpm test
  • I ran pnpm run build
  • This is the smallest safe root-cause fix (no unnecessary hook/output mutation logic)
  • I preserved behavioral invariants and updated/added boundary tests as needed
  • I updated docs for user-facing workflow/command/config changes (README.md and CONTRIBUTING.md when applicable)
  • For new API-key/token providers, I started from contributing/provider-template/ or explained why the template does not apply
  • For provider setup/auth wording changes, I checked the relevant dummy .ts template in contributing/provider-template/ and verified README.md against src/lib/provider-metadata.ts (authentication/authFallbacks) and provider auth resolver/diagnostics behavior

Switch from per-model retrieveUserQuota to grouped retrieveUserQuotaSummary endpoint. The new API returns model families (e.g. "Gemini Models", "Claude and GPT models") with weekly/5h buckets, eliminating client-side model name parsing and aggregation. Add rankOverride/groupSortOverride fields for explicit intra-group and inter-group ordering. Filter disabled buckets before display. Merge summary groups across accounts keeping minimum remainingFraction.

Assisted-by: GLM 5.1
@anthonyhaussman anthonyhaussman marked this pull request as ready for review June 25, 2026 04:54
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