Skip to content

feat(gui): per-account quota table on the Providers accounts tab - #8721

Closed
andrew05060414 wants to merge 9 commits into
lidge-jun:devfrom
andrew05060414:feat/account-quota-table
Closed

andrew05060414 wants to merge 9 commits into
lidge-jun:devfrom
andrew05060414:feat/account-quota-table

Conversation

@andrew05060414

@andrew05060414 andrew05060414 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Problem. With many accounts on one provider (ten Antigravity accounts on mixed plans, several Codex accounts), the Accounts tab is a long stack of cards. Answering "which account still has Claude & GPT left, and when does each reset" means scrolling through every card.

After this PR. When a provider has two or more accounts, the Accounts tab opens with one table, one row per account:

  • Plan from the upstream tier field already stored with the credential (loadCodeAssist paidTier/currentTier for Antigravity, chatgpt_plan_type for Codex, the Anthropic subscription label). Known ids map to a product name (g1-pro-tier shows as Pro), unknown ids show raw, and a missing tier shows "Unknown plan" rather than a guess. The raw tier is in the tooltip.
  • Quota pools as columns: Gemini, Claude & GPT and Argon for Antigravity; the 5-hour and weekly subscription windows for Codex and Anthropic. Each cell shows remaining % and a reset countdown.
  • One status flag: healthy, paused, sign-in needed, rate limited, quota cooldown, failed probe, slow probe (over 8 s) or quota not read.
  • Actions: pause/resume and the read-only account probe, both existing APIs. The header keeps the existing "Refresh quotas" and "Test all".
  • Quota policy line, plus a "next" marker on the account a scarce pool (Claude & GPT, subscriptions) would spend first under reset-first. Gemini is not marked scarce.

The existing cards below the table are unchanged. The table renders from data the panel already loads and adds no endpoint.

Depends on #8642 (per-account probe). This branch is stacked on it, so the diff includes #8642's commits until it lands. Review the last commit, feat(gui): per-account quota table on the Providers accounts tab.

Details.

  • gui/src/provider-workspace/account-quota-table.ts is the pure model. Pools are a registry (QUOTA_POOLS); each entry names the window labels or standard fields that feed its 5-hour and weekly cells, and model-attributed rows never become a pool. The "next" marker mirrors rankAccountsByResetFirst (weekly reset preferred, usable accounts with headroom only) and is display only.
  • AccountQuotaTable.tsx and its CSS (legacy layer, project bar tokens). Copy for all eleven locales sits in account-probe-copy.ts beside the probe strings.
  • structure/gui-and-management-api.md documents the table.

Verification

English, fake fixture data:

Account quota table

Chinese:

Account quota table, Chinese

Screenshots: local Vite dev server with mocked /api/oauth/accounts responses (fake accounts, no real credentials).

  • bun test tests/gui/account-quota-table.test.ts (new: pool mapping, model rows excluded, subscription pool, the reset-first marker skips paused, limited and exhausted accounts, every flag, plan names, past resets, countdown text), plus tests/gui/provider-workspace-data.test.ts, tests/test-layout.test.ts, tests/server/management-route-registry.test.ts and the file-size ratchet tests: 107 pass, 0 fail.
  • bun run typecheck, bun run lint:gui, bun run privacy:scan, bun run structure:check: pass.
  • Full bun run test was not run locally. On this Windows host the preload git-config guard fails every file because git rejects GIT_CONFIG_GLOBAL=NUL; focused runs used OCX_GIT_CONFIG_GUARD_CHECKOUT pointed at a directory without .git. Coverage beyond the files above is left to CI.
  • The Codex path of the table is covered by the model test but was not screenshotted.

Refreshed on dev 450abd0 (2026-11-13)

Merged the current dev head 450abd02c (merge commit, no history rewrite). Stacked on #8642: it already contains #8642's current head.

  • bun run typecheck, bun run structure:check, bun run skill:surface:check and bun run privacy:scan: exit 0.
  • Renamed the new test to tests/gui/gui-account-quota-table.test.ts: the account- regex seed resolves to server, so the explicit gui entry failed the membership oracle's seed check in tests/test-layout-tooling.test.ts. A gui- name agrees with both.
  • cd gui && npx tsc -b and bun run lint: exit 0.
  • Guards plus this PR's tests (OCX_GIT_CONFIG_GUARD_CHECKOUT pointed at a directory without .git): 180 tests, 174 pass, 6 fail.
  • The 6 failures are the same cases that fail on an untouched dev checkout on this Windows host (test-layout-tooling move end to end ×4 and two structure-ssot git-index cases): their temp repositories run git with GIT_CONFIG_GLOBAL=NUL, which git 2.56 for Windows rejects with fatal: unable to access 'NUL'. None of them touches a file in this PR.
  • Full-suite exception: the full bun run test and bun run test:changed were not run (same host limitation and several worktrees sharing the machine); full coverage is left to CI.
  • Still needs the maintainer-sponsored label: the hygiene gate flags src/server/management/oauth-account-routes.ts (through feat(accounts): read-only per-account Antigravity probe and manual model discovery #8642, which this PR is stacked on). Everything else is ready for review.

Readiness (2026-11-13)

  • Registered the four quota-table strings whose French spelling is the English one (acctTable.actions, and the Gemini, Claude & GPT and Argon pool names) in INTENTIONAL_ENGLISH; gui/tests/fr-localization.test.ts flagged them. 8 pass.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. GUI only, no new endpoint; account labels use the same masked alias or email the cards already show.

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • Required local validation passed; commands, results, and any full-suite exception are documented.

  • I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

- POST /api/oauth/accounts/probe: probe stored google-antigravity accounts
  one by one with their own stored access token (one retrieveUserQuotaSummary
  request under the CLI fingerprint; no refresh, no store write). Verdicts:
  ok, token_expired, suspended, verification_required, rate_limited,
  permission_denied, error, plus HTTP status, reason and sanitized message.
- POST /api/model-discovery/refresh: clear one provider's model cache, run
  catalog convergence, report newArrivals recorded by this call.
- CLI: ocx account probe, ocx models discover (capabilities registered,
  skill surface regenerated).
- GUI: Test / Test all on Antigravity account rows; Discover now panel with
  recently added models under provider settings.

Design: devlog/_plan/261112_account_probe_and_model_discovery/010_design.md
…ount-probe

# Conflicts:
#	skills/ocx/references/01_management_surface.md
With ten Antigravity accounts the accounts tab was a long stack of cards;
comparing which account still had Claude & GPT left, and when each resets,
meant scrolling through all of them.

The tab now opens with one table, one row per account:
- plan from the upstream tier field (g1-pro-tier shows as Pro; a missing tier
  shows "Unknown plan", never a guess; the raw tier is in the tooltip);
- Gemini, Claude & GPT and Argon pools (or the 5-hour/weekly subscription
  windows for Codex and Anthropic), each as remaining % with a reset countdown;
- one status flag: healthy, paused, sign-in needed, rate limited, quota
  cooldown, probe failure, slow probe (>8s) or quota not read;
- pause/resume and the read-only account probe, both existing APIs;
- a one-line quota policy and a "next" marker on the scarce pool's account
  that resets soonest, matching reset-first.

The cards below are unchanged. The table renders from data the panel already
loads; it adds no endpoint.
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@github-actions github-actions Bot added the intake: hygiene-blocked Deterministic PR hygiene checks failed label Nov 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Deterministic hygiene checks failed.

  • unsponsored_surface — This changes an authentication, workflow, release-automation, or dependency surface. MAINTAINERS.md requires security review for these; ask a maintainer to apply maintainer-sponsored once they have reviewed it. Paths: src/server/management/oauth-account-routes.ts.

@github-actions github-actions Bot added the enhancement New feature or request label Nov 13, 2026
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • hygiene: unsponsored_surface.

What to do

  • Fix unsponsored_surface — This changes an authentication, workflow, release-automation, or dependency surface. MAINTAINERS.md requires security review for these; ask a maintainer to apply maintainer-sponsored once they have reviewed it. Paths: src/server/management/oauth-account-routes.ts.

Review readiness checklist

  • ✅ Required local validation passed; commands, results, and any full-suite exception are documented.
  • ✅ I pushed my PR to a recent dev commit (at most 10 behind; a maintainer may still ask for the exact tip before merge).
  • ✅ I resolved all correct Codex and CodeRabbit findings.
  • ✅ My PR is ready for review.

✅ 4/4 boxes ticked.

This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

Hygiene

⚠️ Deterministic hygiene checks failed.

  • unsponsored_surface — This changes an authentication, workflow, release-automation, or dependency surface. MAINTAINERS.md requires security review for these; ask a maintainer to apply maintainer-sponsored once they have reviewed it. Paths: src/server/management/oauth-account-routes.ts.

…e gui seed places it

The account- seed resolves to server, so the explicit gui entry tripped the membership oracle's seed check. A gui- name agrees with both.
@andrew05060414

Copy link
Copy Markdown
Contributor Author

Superseded by #8740, which carries this change together with the related accounts and credentials PRs as one commit each on current dev, with no stacking. The design notes in this description still apply.

lidge-jun pushed a commit to andrew05060414/opencodex that referenced this pull request Nov 19, 2026
lidge-jun pushed a commit to andrew05060414/opencodex that referenced this pull request Nov 19, 2026
lidge-jun pushed a commit to andrew05060414/opencodex that referenced this pull request Nov 19, 2026
lidge-jun pushed a commit to andrew05060414/opencodex that referenced this pull request Nov 19, 2026
lidge-jun added a commit that referenced this pull request Nov 19, 2026
…family rotation, verified Vertex ADC (#8740)

* feat(accounts): read-only per-account Antigravity probe and manual model discovery

Original PR: #8642

* fix(antigravity): scope round-robin and session affinity per quota family

Original PR: #8664

* feat(gui): per-account quota table on the Providers accounts tab

Original PR: #8721

* fix(vertex): show gcloud ADC credentials as verified once a token is minted

Original PR: #8720

* fix(gui): tighten the account quota table, probe line and discovery panel

Drop the table's Actions column (it duplicated the card buttons and overflowed),
show one cell for a row with no reading and a dash for a pool an account lacks,
label remaining as "% left" beside cards that show "% used", keep Test all in
the header action group, show card plans by product name, omit evidence for a
usable probe, and hide model discovery while live discovery is off.

* fix(gui): a verified Vertex ADC row keeps the host-credentials auth label

Once vertexCredentialVerified was true the row fell through to "API key".

* fix(cli): models discover exits nonzero when the server reports a failed discovery

* fix(quota): an Antigravity probe re-reads the roster so a pause made mid-run suppresses its request

* fix(models): discovery refresh reports GET's arrival state and fetches even when catalog convergence gathers nothing

* fix(vertex): a failed older ADC exchange no longer erases a newer exchange's verification

* fix(oauth): Antigravity model-listing reroutes skip a sibling whose quota family is exhausted

* fix(gui): a late initial read no longer replaces refreshed arrivals, and a Vertex verification change resets the probe

* fix(gui): the account table marks a next account only under reset-first

* docs(structure): account plan badges show mapped names; the next marker needs reset-first

* feat(gui): make the account quota table the one OAuth account list

The Accounts tab showed every account twice: the compact quota table on top
and the older per-account cards below it. The table now carries each card's
controls (pause/resume, reauthenticate, test, alias, remove, reset grants and
coupons) in an actions column, and a detail line under a row keeps the hints,
probe result, Anthropic per-account threshold and any quota window no pool
column shows. The card list is removed for generic OAuth providers.

Below a 900px container width the rows stack (account, plan and status, then
one line per pool, then the controls) so no button needs sideways scrolling;
above it the actions column stays pinned to the right edge.

* feat(gui): show an upstream-banned account as one red row in the account list

An account auto-paused with reason account_permission_denied now reads
"Banned upstream" in the status column, and its quota cells are replaced by
one notice (automatic refresh stopped) with a "View reason" disclosure that
shows the redacted upstream message, pause time and HTTP status when the
server recorded them. Resume stays the manual way back. needsReauthReason
verify_account reads "Verification needed" instead of the generic sign-in
flag. pauseDetails gains the optional message and statusCode fields.

* fix(gui): stack account rows below 1100px so the pinned actions never cover the status

At a 980px container the English table is wider than its box, and the
right-pinned actions column sat on top of the status column. The provider
workspace caps content at about 960px, so the stacked layout is now the one
the dashboard shows; the table layout stays for wider containers.

* fix(accounts): keep the last good model list on Discover now; show the ban notice without quota readings; treat an expired token as routine

* test(accounts): cover banned rows, verification flag, probe controls, and expired-token flag

* Test account probe transport and management boundaries

* Harden stored-account probes and finish dashboard and CLI parity

* Document discovery within the catalog reference budget

* Give the OAuth quota table room for desktop columns

* Require a live observation for manual model discovery

* Scope manual discovery and keep Antigravity account probes read-only

Respect model discovery cooldown, join concurrent requests, and keep
manual discovery and arrival processing scoped to the requested provider.
Bound pinned error bodies for per-account probes and resolve CLI targets
through a passive store read. Preserve stale quota diagnostics and render
unknown tier IDs as text.

* Keep full provider policy context for scoped model discovery

Scope the captured provider fetches while retaining the configuration
that decides alias ownership and catalog projection.

* Share scoped and full catalog provider discovery

Join in-flight discovery at the provider boundary under the same resolved
credential and policy. Fence model cache publication so delayed results
cannot replace a newer roster, while preserving discovery backoff.

Derive and publish combo omissions only during full gathers.

* Fence shared catalog discovery by credential and outcome

* Resolve provider workspace React Doctor findings

* Preserve caller-local Copilot rows after supersession

* Fence model discovery at admission and catalog publication

* Cover superseded discovery on model listing routes

* Project superseded discovery for model listing reads

* Keep superseded Claude listings from replacing Desktop aliases

* Preserve complete Desktop snapshots when discovery is superseded

Keep the last complete snapshot while its aliases still resolve to the
same routes. Report a retryable 503 when no usable snapshot exists so
connected apply keeps the previous static profile. Keep the existing
Anthropic listing projection and exercise the production apply path.

* Document Desktop snapshot retries in the Spanish API reference

Keep the English and Spanish response identifiers in sync with the
Desktop snapshot retry contract.

* Bind Desktop snapshot retries to listing policy

* fix(desktop): retry superseded model snapshots

* test(gui): update OAuth account quota table assertions

* Extract Anthropic model listing from server serve options

* fix(gui): show pause evidence in banned quota rows

---------

Co-authored-by: JUN <jun@lidgeai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request intake: hygiene-blocked Deterministic PR hygiene checks failed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant