Skip to content

feat(gui): unify current and per-account quota visibility - #3598

Merged
lidge-jun merged 30 commits into
devfrom
codex/provider-quota-parity
Sep 5, 2026
Merged

feat(gui): unify current and per-account quota visibility#3598
lidge-jun merged 30 commits into
devfrom
codex/provider-quota-parity

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Summary

  • Show Current account usage below statistics on provider Overview and Usage; Accounts/API keys show each credential separately using the same credit/window and reading-state component.
  • Keep pool totals separate from the current account and prevent an unobserved active passive account from inheriting a prior report. Distinguish unsupported, unobserved, pending, unavailable-with-last-good and measured zero.
  • Await forced account/key enrichment and the matching provider-report epoch. Keep explicit backend null authoritative, bound loading, reject superseded results, and use honest check-completed feedback.

Stack (merge bottom-up):

  1. fix(usage): distinguish unresolved fallback models and reject missing policies #3582 — attribution and missing-policy rejection.
  2. feat(quota): expose per-account OAuth and API-key usage #3584 — credential-scoped quota API.
  3. This PR — GUI integration (base codex/provider-account-quota-api).
  4. Update-recovery fixture Codex-home isolation — test-only follow-up based on this branch.

Depends on #3584. Review this layer's diff only. State-contract tests and synthetic screenshots account for much of the diff; current and all-account consumers use one renderer.

Verification

  • No local tests, typecheck, build, lint or scans; all command-based verification is delegated to exact-head remote CI per maintainer instruction.
  • Real production components observed in the in-app browser with synthetic data only: Overview, Usage, distinct OAuth accounts, separate key balances, passive-account switch, pool current vs aggregate, unsupported state, tablet767px and mobile390px containment, pointer/keyboard refresh.
  • Integrated independent code review and explicit automated security review passed at8960ddba8 (not human approval). Fixed management destinations, unchanged authorization, credential/data isolation, authoritative null, passive no-probe and safe rendering were checked. Remote GUI tests:1396 pass/0 fail; all four backend shards and common gates passed. Remaining platform checks are mandatory before merge.
  • Commit and push used --no-verify.

GUI current-account usage below Overview statistics — synthetic data
GUI current-account usage below model usage — synthetic data
GUI per-key balances — synthetic data

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.

The maintainer authorized bottom-up admin merge only after successful exact-head CI and resolution of correct findings. No release, live service restart or user usage-history rewrite is included.

@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 5, 2026 03:23
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^dev$
  • ^preview$

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: de48ae09-f190-476c-93af-7ae901725d70

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-05T03:28:58.270231Z d78a02a PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Sep 5, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d78a02a63d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread gui/src/hooks/useProviderAccountPools.ts
@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 52 / 80

이 PR은 베이스가 dev가 아닙니다. 베이스는 codex/provider-account-quota-api(#3584)이고, 그 아래는 아직 열린 #3582(attribution)입니다. 스택은 #3582#3584 → 이 PR(#3598) 순으로 아래에서 위로 합쳐야 합니다. 하는 일은 provider GUI에서 “지금 쓰는 계정” 사용량과 “계정/키마다” 사용량을 같은 읽기 상태 컴포넌트로 보여주는 것입니다. Overview·Usage에는 ProviderCurrentQuota를 두고, Accounts/API keys 목록은 ProviderAccountQuota로 통일합니다.

현재 dev(850afb2e9)는 쿼ota 서버 쪽 캐리(#3587/#3592/#3588 등)가 이미 들어가 있지만, 이 GUI가 기대하는 credential-scoped quota API(#3584)와 unresolved fallback attribution(#3582)은 아직 dev에 없습니다. 그래서 이 diff만 보면 “표시를 맞추는 일”인데, 단독으로는 랜딩할 수 없습니다. 핵심 계약은 풀 합계를 현재 계정 숫자로 쓰지 않는 것(currentAccountQuotaReport), 관측 안 된 passive 계정이 예전 리포트를 물려받지 않는 것, unsupported / unobserved / pending / unavailable-with-last-good / measured zero를 구분하는 것입니다. useProviderAccountPools는 roster를 먼저 읽고 &quota=1로 보강하며, generation·AbortController·apiBase 전환 시 상태를 비우는 쪽으로 정리했습니다.

작성자가 로컬 테스트·typecheck를 돌리지 않고 remote CI만 쓰라고 적어 두었습니다. 지금 CI는 일부 게이트는 통과했고 Linux/macOS 샤드가 아직 돌아가는 중입니다. 상태 계약 테스트와 합성 스크린샷이 diff의 큰 몫이라, 리뷰 초점은 “숫자 계산”보다 “어느 읽기가 권위인지”에 두는 게 맞습니다.

gui/src/pages/Providers.tsx / 스택 - 베이스가 dev가 아니고 #3584·#3582가 아직 열림입니다. 이 PR만 머지하면 깨지거나, 반대로 아래 층이 바뀌면 GUI 계약이 다시 흔들립니다.

PR 본문 Verification - 로컬 스위트 생략과 --no-verify push입니다. exact-head remote CI가 유일한 게이트이므로, 초록이 나오기 전에 admin squash하면 안 됩니다.

gui/src/components/provider-workspace/ProviderCurrentQuota.tsx - 새로고침 성공/실패 표시가 컴포넌트 로컬 state입니다. AuthPanel 쪽은 connection identity로 stale result를 막는데, Overview/Usage의 current 블록은 provider를 빠르게 바꾸면 이전 결과가 잠깐 남을 수 있습니다.

gui/src/hooks/useProviderAccountPools.ts - enrichment 실패 시 unavailableQuotaRows로 표시합니다. 일시적 네트워크 실패와 “자격 증명 만료”를 같은 unavailable로 묶으면, 마지막 good 값을 보여줄지 말지 UX 기대가 어긋날 수 있습니다. 테스트가 그 경계를 고정하는지만 CI 로그로 한 번 더 확인하세요.

메인테이너의 판단이 필요한 지점

너의 추천
지금은 머지하지 마세요. #3582와 #3584가 dev에 들어간 뒤, 이 브랜치를 그 HEAD에 리베이스(또는 스택 재생성)하고 exact-head CI가 전부 초록일 때 합치세요. current refresh stale 표시는 작은 follow-up으로 빼도 됩니다.

이 댓글은 grok-bot이 작성했습니다

t added 18 commits September 5, 2026 12:59
…ccount-quota-api

# Conflicts:
#	devlog/_plan/260905_provider_usage_quota_parity/040_stack_landing.md
@lidge-jun
lidge-jun changed the base branch from codex/provider-account-quota-api to dev September 5, 2026 12:11
@lidge-jun
lidge-jun merged commit 7977df4 into dev Sep 5, 2026
27 of 45 checks passed
@lidge-jun
lidge-jun deleted the codex/provider-quota-parity branch September 5, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant