Skip to content

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

Closed
andrew05060414 wants to merge 5 commits into
lidge-jun:devfrom
andrew05060414:feat/antigravity-account-probe
Closed

andrew05060414 wants to merge 5 commits into
lidge-jun:devfrom
andrew05060414:feat/antigravity-account-probe

Conversation

@andrew05060414

@andrew05060414 andrew05060414 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Operators with many Google Antigravity accounts currently cannot tell, without reading logs, which stored accounts still work or which models a provider exposes right now. This adds two read-only actions, each with a CLI command and a dashboard control:

  • Per-account probe — POST /api/oauth/accounts/probe { provider: "google-antigravity", accountId? }, ocx account probe google-antigravity [id|alias] [--json], and Test / Test all buttons on Antigravity account rows. Each account gets one retrieveUserQuotaSummary request with its own stored access token under the CLI fingerprint. The answer is classified as ok, rate_limited, verification_required, suspended, permission_denied or error, with the HTTP status and Google's ErrorInfo reason (secret-redacted).
    • paused and token_expired are decided locally and send nothing. A paused account is left alone. An expired token is reported, not refreshed.
    • The probe never refreshes a token, never writes the auth store, and never changes pause, active, cooldown or health state. The test asserts that auth.json is byte-identical after a run and that no token appears in the result.
  • Manual model discovery — POST /api/model-discovery/refresh { provider }, ocx models discover <provider> [--json], and a Discover now panel under provider settings that lists recently added models. It runs the existing live discovery immediately instead of waiting for the next scheduled refresh. Providers without live discovery report that discovery is off.

Design note: devlog/_plan/261112_account_probe_and_model_discovery/010_design.md. CLI docs: docs-site/src/content/docs/reference/cli/providers-accounts.md. The skill surface was regenerated with bun run skill:surface, and the 11 locales are in gui/src/i18n/account-probe-copy.ts.

Screenshots (fake accounts against a fake upstream, so no real credentials were involved):

Test all on four accounts: usable, rate limited, verification required, and paused (not tested):

Account probe — Test all

Discover now panel under provider settings:

Model discovery — Discover now

Verification

All commands ran locally on Windows 11 with Bun, on this branch rebased onto dev at f4386e79a.

  • bun run typecheck → exit 0 (no type errors in 2,488 files)
  • bun test tests/server/account-probe-routes.test.ts → 5 pass, 0 fail. It covers the response classifier, per-account tokens with the CLI user agent, no request for paused, expired or project-less accounts, a byte-identical auth store, no token in the output, and the management routes.
  • Focused set: 47 test files covering the account and model CLI commands, CLI capabilities and help, the management routes, the Antigravity quota code and the OAuth tests that import the changed modules → bun test --timeout 30000 <47 files>: 1395 pass, 1 skip, 0 fail
  • bun test tests/test-layout.test.ts → pass. The new test file is registered in scripts/test-layout/layout.json and tests/fixtures/test-layout-expected.json.
  • bun test tests/ci-workflows/repo-hygiene.test.ts tests/ci-workflows/skill-ocx.test.ts → 31 pass, 0 fail
  • bun test tests/ci-workflows/skill-ocx-workflows.test.ts tests/ci-workflows/docs-429-failover-claims.test.ts → 38 pass, 0 fail
  • bun run skill:surface:check → all 9 generated surface files current
  • bun run privacy:scan → passed
  • bun run structure:check → passed
  • bun run lint:gui → exit 0. bun run build:gui → exit 0.
  • Manual: I ran a local instance with four fake Antigravity accounts and an in-process fake quota transport, then clicked Test all (screenshot above). The paused account showed "Paused (not tested)" and the fake upstream recorded no request for it.

Not passing locally / not run:

  • bun run test:changed did not finish. It hit the 900 s suite limit (exit 124) with 98 failures. 56 of those were per-test 5 s timeouts and 27 were hook timeouts, in unrelated areas: Copilot Auto, lane release, JEV and Codex catalog. Other worktrees were running suites on the same machine at the time. None of the failures are in the probe or discovery code. I am relying on the PR's Ubuntu test changed job for this.
  • tests/test-layout-tooling.test.ts: 27 pass, 2 fail. Both failures are git commit / git mv timing out after 5 s in a scratch repository (move end to end). That is environment slowness, not this change; the layout-registration cases pass.
  • The full bun run test suite was not run for the same reason: the machine was contended and test:changed alone exceeded 900 s. That run is left to CI.

Refreshed on dev 86be880 (2026-11-13)

Merged the current dev head 86be8805c into the branch (merge commit, no history rewrite).

  • bun run typecheck, bun run structure:check, bun run skill:surface:check and bun run privacy:scan all exit 0. Focused run: the layout, file-size ratchet, repo-hygiene, management route registry, skill-ocx, structure-ssot and import-cycle guards plus every test file this PR adds or changes.
  • 174 tests across the guards and this PR's files: 165 pass, 1 skip, 7 fail.
  • The 7 failures are the same 7 cases that fail on an untouched dev checkout on this Windows host (test-layout-tooling rewriteSpecifier / move end to end ×5 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 rerun for this refresh. This host runs several worktrees at once and an earlier test:changed hit 900 s with timeouts in unrelated modules, so full coverage is left to CI.
  • Still needs the maintainer-sponsored label: the hygiene gate flags src/server/management/oauth-account-routes.ts. Everything else is ready for review.

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.

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
@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.

…ount-probe

# Conflicts:
#	skills/ocx/references/01_management_surface.md
@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