Skip to content

[WRONG BRANCH] feat(gui): redesigned OAuth accounts workspace (carry #5408) - #7169

Closed
lidge-jun wants to merge 5 commits into
carry/5408-pool-controlsfrom
carry/5408-accounts-workspace
Closed

lidge-jun wants to merge 5 commits into
carry/5408-pool-controlsfrom
carry/5408-accounts-workspace

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Third slice carried from #5408 by @agentHits (source head 2db983800a02785250cc3ebed86f399bc772303e), stacked on #7168, which is stacked on #7167. Both refreshed parent heads are merged into this branch without force-pushing.

OAuth account lists become cards or compact rows with search, quota filters, sorting, title/view switches, removal confirmation scoped to provider and server, and Antigravity's browser-login/Cockpit Tools import chooser. Existing pause, switch, alias, reauthentication, coupon/reset-grant and Anthropic threshold controls remain. Generic pool controls use #7168's single card and preserve Kiro's CLI strategy.

Independent review implemented all four owner UI decisions:

  • Removed the fixed-capacity / guessed-weekly remaining-token estimator and its unused locale copy.
  • Accounts with no readings display Quota unknown, contribute zero to available counts, and are excluded from available filters. All accounts is the default, keeping unknown accounts visible. Per-window counts require measured readings. Unknown is translated in all 11 locales.
  • Restored Logout beside the signed-in status even when the account roster is populated, matching dev's placement.
  • Kept one refresh in the Accounts tab header, removed the duplicate toolbar/footer and per-card force buttons, and made tab reads use settled cache. Cached reads await quota enrichment and settle the matching operator ticket. Existing explicit force controls, including the aggregate overview and dedicated Codex flow, remain available.

The 30-second roster poll stays cached, mount-time forced refresh stays removed, and quota rosters retain four workers. The API's targeted accountId support remains independently usable; it does not add a force button. Removal is bound to provider plus API base. Changed management routes retain the shared management-auth and origin gates.

Screenshots

Real GUI builds served by sandboxed proxies, three synthetic Antigravity accounts without quota readings. Google Chrome/Playwright startup timed out on this machine (even Google Chrome --version hung at process startup); these replacement captures use GOAT's shared Chromium browser. No screenshot files are committed to a PR branch.

Before (origin/dev 7640a94) After (reviewed branch build)
before after

Co-authored-by: agentHits 140916359+agentHits@users.noreply.github.com

Verification

Fresh runs on macOS arm64 / Bun 1.4.3, all tests/proxies with temporary OPENCODEX_HOME and CODEX_HOME, proxies on non-default ports:

  • cd gui && bun run test: 3355 pass / 0 fail, 343 files. This includes all parent-layer fixes. After the final compact-badge-only cleanup, bun ../scripts/test-with-pinned-bun.ts --isolate tests/provider-quota-refresh-controls.test.tsx: 15 pass / 0 fail; bun run build: pass.
  • bun scripts/test.ts --parallel=1 tests/gui/gui-account-quota-analysis.test.ts: 12 pass / 0 fail; bun scripts/test.ts --parallel=1 tests/server/server-management-auth.test.ts: 47 pass / 0 fail.
  • Inherited layer-a routing/API/CLI regression set: 185 pass / 0 fail. Layer-b strategy/UI set: 72 pass / 0 fail. Both Kiro regression cases were verified red before their fixes.
  • bun run typecheck, cd gui && bun run lint, cd gui && bun run lint:i18n, bun run build:gui, bun run structure:check, bun run privacy:scan, bun scripts/file-size-ratchet.ts: pass. cd docs-site && bun install --frozen-lockfile && bun run build: pass (577 pages).
  • Real-browser smoke: all three unmeasured cards show unknown, one Accounts refresh, logout reachable. Clicking refresh produced /api/oauth/accounts?provider=google-antigravity, /api/provider-quotas, and /api/oauth/accounts?provider=google-antigravity&quota=1, without refresh=1. Synthetic accounts have no project id, so the screenshot's unavailable-quota result is expected.
  • Requested OPENCODEX_HOME=$(mktemp -d) CODEX_HOME=$(mktemp -d) OCX_TEST_NO_QUEUE=1 bun run test:changed initial run completed: 40505 pass / 107 skip / 22 fail / 4 errors across 1866 files. Final-stack rerun completed in 372.4 seconds: 40507 pass / 107 skip / 21 fail / 4 errors, 1866 files. Its failures are the four baseline audio/sibling cases plus 17 service/ownership/toggle cases that pass in scoped runs on both trees. This is not a green root-suite claim.
  • Clean origin/dev 7640a94, same nine initially failing files via bun scripts/test.ts --parallel=1: 518 pass / 4 fail / 4 errors. It reproduces three audio-readiness timeouts, sibling-home ensure timeout, and audio JSON/transport errors. Service/ownership/toggle failures do not reproduce in scoped runs. A tip rerun of the six service/toggle/headless files gave 398 pass / 2 fail, both 5-second headless CLI timeouts; bun scripts/test.ts --parallel=1 --timeout=30000 tests/cli/cli-headless-parity.test.ts then passed 100/0 on both tip and clean dev. Broad-run-only ordering effects remain for CI to assess.
  • Cross-platform CI dispatched at 4b7d9b0: https://github.com/lidge-jun/opencodex/actions/runs/38719469500 (queued; not passing evidence). Required PR checks were inspected and remain queued.
  • Concurrent triage worktrees share this machine. An additional full root run is omitted under the repository's resource exception; the requested changed suite, full GUI suite and focused regressions were run. Cross-platform CI is dispatched on the exact published head; pending results are not passing evidence.

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.

OAuth account lists become a card grid (or compact rows) with a toolbar for
search, quota filters, sorting, title mode and view mode, pool availability
and token estimates, and per-family Gemini/Claude limits for Antigravity.
Each card keeps pause/resume, switch, alias, reauth, Grok coupons, Claude
reset grants, the Kiro skip reason and the Anthropic per-account threshold.
Removal asks in a dialog bound to the provider and server it was opened for.
Antigravity gets a Cockpit Tools import card and an auth-choice modal, and
the provider rail can collapse.

A per-account refresh forces only that account upstream (accountId on
GET /api/oauth/accounts; an unknown id forces all). The pools hook keeps the
latest quota outcome with its generation, so a superseded refresh succeeds
only when a newer outcome succeeded. The list rereads cached quota every 30s
while visible; it does not force upstream probes, and the mount-time forced
refresh is gone. Quota rosters keep four workers.

Carried from #5408 (source head 2db9838).

Co-authored-by: agentHits <140916359+agentHits@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 15, 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: Repository: lidge-jun/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: a16a7df8-7bca-44c8-8bb3-de5a4263777f

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
  • 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

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 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-10-15T10:26:08.706766Z 4b7d9b0 Draft marked ready
ℹ️ 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.

@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: 4b7d9b00f4

ℹ️ 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 on lines +226 to +230
<button
type="button"
className="pwi-dense-select-btn"
disabled={disabled || active || paused}
onClick={() => onSwitch(account)}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Block selection of unhealthy accounts

When an inactive account has needsReauth/reauth_required or a cooldown health status, this button remains enabled because it checks only disabled, active, and paused. The previous account list explicitly blocked both reauthentication and cooldown states, while the management route rejects only paused accounts, so clicking the redesigned card can make a credential known to be unusable the active account. Restore the health-state checks before invoking onSwitch.

AGENTS.md reference: gui/AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

Comment on lines +502 to +509
{(analyzed.generic5h || analyzed.genericWeekly) ? (
<>
{renderSingleQuotaBar(t("pws.window5hLabel"), analyzed.generic5h?.percent, analyzed.generic5h?.resetAt)}
{renderSingleQuotaBar(t("pws.windowWeeklyLabel"), analyzed.genericWeekly?.percent, analyzed.genericWeekly?.resetAt)}
</>
) : (
<ProviderAccountQuota quotaMode={account.quotaMode} quota={account.quota}
quotaUnavailable={account.quotaUnavailable} quotaPending={account.quotaPending} quotaFailure={account.quotaFailure} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep custom quota windows visible beside standard windows

When a non-Antigravity account has a standard 5-hour or weekly reading, this branch bypasses ProviderAccountQuota and renders only those two fields. Anthropic normally returns those fields together with model-family windows such as Opus, Sonnet, and Fable, so the redesigned cards hide the family limits that the old renderer displayed; the compact branch has the same conditional. Render the custom windows as well or continue using the complete quota renderer.

AGENTS.md reference: gui/AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

Comment on lines +203 to +210
const allPercents: number[] = [];
if (gemVals.length > 0) allPercents.push(...gemVals);
if (claVals.length > 0) allPercents.push(...claVals);
if (generic5h) allPercents.push(generic5h.percent);
if (genericWeekly) allPercents.push(genericWeekly.percent);
for (const w of customWindows) {
if (typeof w.percent === "number") allPercents.push(w.percent);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Include monthly quota in readiness calculations

For providers whose account quota is monthly-only, notably paid Kiro accounts without a free-trial custom window, allPercents stays empty because monthlyPercent is never added. The card can still render the monthly bar through ProviderAccountQuota, but the toolbar labels the same account as quota-unknown, reports it unavailable, sorts it with zero headroom, and removes it under the “with limits” filter. Include the monthly reading and reset data in the analysis.

AGENTS.md reference: gui/AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

Comment on lines +208 to +210
for (const w of customWindows) {
if (typeof w.percent === "number") allPercents.push(w.percent);
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Do not treat one model-scoped limit as account exhaustion

When an Anthropic account has usable provider-wide limits but one scope: "model" custom window is exhausted (for example Opus at 100% while weekly usage is 20%), adding every custom percentage to this maximum makes fullyExhausted true and hasAnyLimitsLeft false. The toolbar then reports the whole account exhausted and the availability filter hides it even though other model families remain usable. Preserve the quota-window scope in the client type and exclude model-scoped windows from account-wide readiness.

AGENTS.md reference: gui/AGENTS.md:L9-L10

Useful? React with 👍 / 👎.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the enhancement New feature or request label Oct 15, 2026
@lidge-jun

Copy link
Copy Markdown
Owner Author

Closing at the maintainer's request: we are not taking the redesigned OAuth accounts workspace UI. The backend reset-first slice from #5408 continues separately in #7167. The branch is kept, so this can be reopened if the direction changes.

@lidge-jun lidge-jun closed this Oct 15, 2026
@github-actions github-actions Bot changed the title feat(gui): redesigned OAuth accounts workspace (carry #5408) [WRONG BRANCH] feat(gui): redesigned OAuth accounts workspace (carry #5408) Oct 15, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • wrong target branch (carry/5408-pool-controls); retarget to dev.

What to do

  • Retarget this PR to dev — all contributions go to dev.

Its title has been prefixed with [WRONG BRANCH].
Automatic draft conversion failed (token cannot change draft status). Please convert this pull request to a draft manually. The required enforce-target check will keep failing until every issue above is resolved.

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