Skip to content

[Feature]: populate OAuthAccountSummary.plan for anthropic and google-antigravity from profile / loadCodeAssist #6935

Closed

Description

@vibewriter-hand

Summary

/api/oauth/accounts returns plan: null for anthropic and google-antigravity accounts. The source comments say upstream exposes no tier field (src/oauth/index.ts near the plan: null line, src/providers/quota/vendor-probes-oauth.ts doc comment on fetchAnthropicUsageQuota). That is true for /api/oauth/usage and the token response, but both providers return the tier on another endpoint that OpenCodex already calls.

Evidence (ocx 2.81.0, measured 2026-10-11, emails masked)

Anthropic: GET https://api.anthropic.com/api/oauth/profile (anthropic-beta: oauth-2025-04-20)

src/oauth/anthropic-identity.ts already calls this endpoint, but it keeps only account.uuid. The same body carries the tier:

account has_claude_max organization.organization_type organization.rate_limit_tier
h***t true claude_max default_claude_max_20x
h***0 true claude_max default_claude_max_20x
d***5 true claude_max default_claude_max_20x
s***l true claude_max default_claude_max_5x
a***f true claude_max default_claude_max_5x

organization fields seen: billing_type, organization_type, rate_limit_tier, seat_tier, subscription_status, subscription_created_at, has_extra_usage_enabled. Claude Code itself stores the same value as subscriptionType / rateLimitTier in its credentials.

Google Antigravity: POST https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist ({"metadata":{"ideType":"ANTIGRAVITY"}})

src/oauth/google-antigravity.ts (loadCodeAssistProject) already calls this endpoint, but it keeps only the project id. The body carries currentTier and paidTier:

account currentTier.id paidTier.id / name
h***t free-tier g1-pro-tier / Google AI Pro
h***0 free-tier g1-ultra-lite-tier / Google AI Ultra

Note that currentTier is free-tier for paid accounts; paidTier is the field that names the subscription.

Impact

Fleet capacity math (per-seat weights) cannot use plan, so tools must guess. Percentages are normalized per account (as the comments correctly say), so a Max 5x seat and a Max 20x seat look the same. In our setup the guess overstated two Max 5x seats by 4x until we pinned the measured tiers by hand.

Proposed change

  1. Anthropic: in resolveAnthropicAccountIdentity (or a sibling read), also keep organization.rate_limit_tier (and optionally organization_type / seat_tier) and expose it as OAuthAccountSummary.plan (for example max_20x, max_5x, pro).
  2. Antigravity: in loadCodeAssistProject, also keep paidTier.id (fall back to currentTier.id) and expose it as plan.
  3. Keep null when the read fails, so nothing is inferred from quota percentages.

The profile call is already made with the same bearer, so this needs no new request on the Anthropic side.

Activity

  1. added
    enhancement
    account-pool
    on Oct 11, 2026
  2. lidge-jun commented on Oct 11, 2026

    @lidge-jun
    Owner

    Fixed on dev by #6953 (777b377): OAuthAccountSummary.plan now reports the validated Anthropic organization tier and the Antigravity paidTier/currentTier, and stays null when unknown.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolenhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions