Repository navigation
fix(vertex): show gcloud ADC credentials as verified once a token is minted - #8720
Closed
andrew05060414 wants to merge 5 commits into
Closed
andrew05060414 wants to merge 5 commits into
andrew05060414 wants to merge 5 commits into
Conversation
A Google Vertex provider on Application Default Credentials (gcloud login or a gcp-sa: marker) showed "Credentials unverified" forever. The dashboard decided it from the config shape alone, and the connection test returned static_catalog before touching credentials, so nothing could ever clear it. - gcp-adc records the credential source of the last successful token exchange; the config DTO exposes vertexCredentialVerified for ambient/marker rows. The proof lapses when the ADC file or marker changes, and a refused exchange clears it. - The static-catalog connection test now mints a Vertex ADC token instead of skipping, so the button verifies the login. Other static catalogs still skip. - The overview treats a passing connection test as verified immediately.
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
Contributor
|
Contributor
⏳ DRAFT
What to do
Review readiness checklist
✅ 4/4 boxes ticked. This pull request was already a draft. Its draft status will be preserved after every issue above is resolved. Hygiene
|
…lag it reads vertexUnverified now depends on the connection test result, so its declaration moved below the probe state; effectiveStatus still read it above, a temporal-dead-zone ReferenceError on render and a tsc -b error.
5 of 7 tasks
Contributor
Author
|
Superseded by #8740, which carries this change together with the related accounts and credentials PRs as one commit each on current |
2 of 3 tasks
lidge-jun
added a commit
that referenced
this pull request
Nov 16, 2026
…ed Vertex ADC (carries #8740, #8750) (#8778) * fix(antigravity): scope round-robin and session affinity per quota family Round-robin peeked a model-filtered ring but committed on the unfiltered account list, so the realign path reseeded the ring and the next request got the same account. Both sides now read the same model- and exhaustion-filtered list, and the ring key carries the quota family (genericPoolKey(provider, family)), so a Gemini request no longer moves the Claude ring. Conversation affinity keeps one binding per family with the family-less key as a read fallback. Accounts with known zero headroom for the requested family are dropped unless every listing account is spent, including on the model-listing reroute. A manual selection seeds the provider ring and both family rings. Source: #8740 (fef2c75, b9dd5db), originally #8664. Co-authored-by: Andrew (agent) <wsy1731095638@gmail.com> * fix(antigravity): rotate to a sibling account when one account's 403 is refused A pooled google-antigravity account whose credential Google refused answered every request with 403 PERMISSION_DENIED, and the pool kept sending to it: only the VALIDATION_REQUIRED shape rotated. A plain access-denied 403 now cools the refused credential generation for 60 seconds (the existing auth cooldown, no needs-reauth mark) and replays on the next live sibling, repeating while siblings remain up to the failover limit. A 403 whose PERMISSION_DENIED body is worded as invalid credentials normalizes to "authentication failed" and is treated the same way. The verify-account shape keeps its durable quarantine path on both the main dispatch and the web-search sidecar. The sidecar accepts the same plain refusal for its one rotation, so the web-search validation cases that used to assert "never rotates" for unrelated, spoofed and malformed 403 bodies now assert one sibling rotation with nothing persisted; verify-account wording and oversized bodies still never rotate. Source: #8750 (7441a44). Co-authored-by: Andrew (agent) <wsy1731095638@gmail.com> * fix(antigravity): replay a 502/503/504 once on a sibling and share one cooldown write The transient ladder retried a failing Antigravity account only against itself, so one account stuck on 503/504 kept answering every request that landed on it. After the ladder gives up before any output, the request now replays once on a live sibling and the failed account is cooled for 15 seconds (process-local, no stored verdict). One hop per request keeps a pool-wide outage to two ladders. The 403 refusal and the 5xx fault now take one rotation path: both pick the sibling through nextAntigravitySibling and dispatch through rotateAntigravityAuth, which checks the failover limit before any cooldown is written. Both cooldowns go through coolAntigravityAccount, fenced on the sent credential generation and never shortening a cooldown already running for the account and family, so a 15-second fault window cannot cut short a 60-second refusal. docs-site (English and Spanish, which carried the old wording) now describes the 403 walk and the 5xx hop. Source: #8750 (bdf1139). Co-authored-by: Andrew (agent) <wsy1731095638@gmail.com> * feat(vertex): show gcloud ADC credentials as verified once a token is minted A Google Vertex provider signed in with Application Default Credentials kept showing "Credentials unverified" because nothing recorded a successful token exchange. src/lib/gcp-adc.ts now records the source and generation of the last successful exchange per credential scope; the proof lapses when the ADC source the next request would use changes, and a failed exchange clears only its own record, never a newer exchange's. safeConfigDTO exposes one boolean, vertexCredentialVerified, for ambient and marker rows (no credential material). The static-catalog branch of POST /api/providers/test mints one Vertex ADC token (new src/server/management/static-catalog-probe.ts); every other static catalog, including Antigravity and API-key Vertex, still answers static_catalog before any credential resolution. The dashboard treats a verified row as ready, keeps its "Host credentials" auth label, and drops a retained probe result when the verification state changes. Docs say the test proves the credential, not Vertex permissions. Source: #8740 (947ed8a, ef78868, 801e772, and the probe-key line of 9e0a92b), originally #8720. Co-authored-by: Andrew (agent) <wsy1731095638@gmail.com> * fix(antigravity): rotate only on Google's structured PERMISSION_DENIED 403 classifyGoogle writes the bare "Antigravity access denied" prefix for every 403, including an empty body, a proxy or WAF HTML page and an envelope without the status enum. hasAntigravityAccessDeniedMarker accepted that prefix, so any 403 walked the pool and wrote a 60 second family cooldown on every account. The marker now requires the "(PERMISSION_DENIED)" suffix classifyGoogle keeps only when it parsed the enum, or the authentication-failed prefix, and still requires classifyAntigravityRefusal(403, text) to be "other". Text carrying the validation marker never qualifies. Unrelated, spoofed and malformed web-search 403 bodies and the oversized or spoofed-prefix main-path variants keep their refusal again; a structured PERMISSION_DENIED earns the one sibling rotation, and an empty, HTML or enum-less 403 is not rotated and cools nothing. Docs and the responses-failover note say what triggers the walk. Co-authored-by: Andrew (agent) <wsy1731095638@gmail.com> * fix(vertex): require an access_token before verifying ADC and skip reference rows in the probe resolveAccessToken recorded "verified" for any 200 token response; a body without a non-empty access_token now fails the exchange before the token cache and the verified record are written. The static-catalog connection test resolved keychain: and ${ENV} reference rows through selectVertexDiscoveryCredential before answering static_catalog. It now classifies the configured text with vertexConfiguredCredentialKind, the rule the dashboard DTO already used, and answers for api-key and reference rows without reading the credential store. The Spanish adapters page no longer claims the static-catalog test verifies nothing, and the structure note describes the probe. Co-authored-by: Andrew (agent) <wsy1731095638@gmail.com> * refactor(pool): drop the unused prefix sweep in clearPoolRotationState No production caller clears a generic provider key, and the one codex caller already clears its scoped keys explicitly, so the prefix sweep never ran for the Antigravity family rings and only widened what clearing the codex key removes. reconcilePoolRotationState alone treats generic:<provider>:<family> keys as part of their provider; the structure note says so, and now records that Antigravity session affinity writes two entries per session. Co-authored-by: Andrew (agent) <wsy1731095638@gmail.com> --------- Co-authored-by: Andrew (agent) <wsy1731095638@gmail.com>
lidge-jun
pushed a commit
to andrew05060414/opencodex
that referenced
this pull request
Nov 19, 2026
…minted Original PR: lidge-jun#8720
lidge-jun
pushed a commit
to andrew05060414/opencodex
that referenced
this pull request
Nov 19, 2026
…minted Original PR: lidge-jun#8720
lidge-jun
pushed a commit
to andrew05060414/opencodex
that referenced
this pull request
Nov 19, 2026
…minted Original PR: lidge-jun#8720
lidge-jun
pushed a commit
to andrew05060414/opencodex
that referenced
this pull request
Nov 19, 2026
…minted Original PR: lidge-jun#8720
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Problem. A Google Vertex provider that authenticates with gcloud Application Default Credentials (
gcloud auth application-default login, or agcp-sa:marker) showed "Credentials unverified" / "Saved — proxy credentials unverified" forever, even when requests worked. The dashboard decided the state from the config shape alone, and the connection test returnedstatic_catalogbefore touching credentials, so nothing could ever clear it.After this PR. Once the proxy has minted an access token from the ADC source it would use now, the provider shows as Ready. "Test connection" on a static-catalog Vertex row now mints that token instead of skipping, so one click verifies a gcloud login. A refused exchange, or a changed ADC file or marker, puts the row back to unverified.
Details.
src/lib/gcp-adc.tsrecords the source and generation of the last successful token exchange per scope (vertexAdcCredentialVerified). No network call; the proof lapses when the observed source changes and is cleared by a failed exchange.safeConfigDTOexposes a booleanvertexCredentialVerifiedfor ambient and marker rows (never any credential material).src/server/management/static-catalog-probe.ts: the static-catalog branch ofPOST /api/providers/testverifies Vertex ADC; every other static catalog (for example Antigravity) still returnsstatic_catalogwithout credential resolution. It is a new file soprovider-routes.tsdoes not grow.Verification
Screenshot: local Vite dev server with mocked API responses (fake data). One Vertex row has
vertexCredentialVerified: true(Ready), the other does not (Credentials unverified).bun test tests/adapters/google/vertex-adc-verified.test.ts tests/adapters/google/gcp-adc.test.ts tests/gui/provider-workspace-data.test.ts tests/adapters/google/vertex-model-discovery.test.ts: all pass. The new test covers: unverified then verified after a mint, a verified row bins as ready, replacing the ADC file drops the proof, a refused exchange is not verified, the static-catalog test verifies ADC and reports a failed exchange, and it still skips Antigravity and API-key rows.gcp-adc.test.tsexpected the old skip; it now expectsok: true, and that test pinsGOOGLE_APPLICATION_CREDENTIALSto its fixture instead of reading the host gcloud directory.bun run typecheck,bun run lint:gui(oxlint),bun run privacy:scan,bun run structure:check,tests/test-layout.test.ts: pass.bun run testwas not run locally. On this Windows host the preload git-config guard andtest-layout-toolingfail for every file becausegitrejectsGIT_CONFIG_GLOBAL=NUL("unable to access 'NUL'"); focused runs usedOCX_GIT_CONFIG_GUARD_CHECKOUTpointed at a directory without.git. Coverage beyond the files above is left to CI.Refreshed on
dev450abd0 (2026-11-13)Merged the current
devhead450abd02c(merge commit, no history rewrite).bun run typecheck,bun run structure:check,bun run skill:surface:checkandbun run privacy:scan: exit 0.gui/src/components/provider-workspace/ProviderOverview.tsx:vertexUnverifiednow reads the connection test result, so its declaration had moved below the probe state whileeffectiveStatusstill read it earlier.cd gui && npx tsc -bfailed with TS2448/TS2454, and rendering a provider overview would have thrown a ReferenceError. The status computation now sits after the flag.cd gui && npx tsc -bandbun run lint: exit 0. The 21 GUI suites that renderProviderOverviewor the provider workspace: 318 pass, 0 fail.OCX_GIT_CONFIG_GUARD_CHECKOUTpointed at a directory without.git): 230 tests, 224 pass, 6 fail.devcheckout on this Windows host (test-layout-toolingmove end to end ×4 and twostructure-ssotgit-index cases): their temp repositories run git withGIT_CONFIG_GLOBAL=NUL, which git 2.56 for Windows rejects withfatal: unable to access 'NUL'. None of them touches a file in this PR.bun run testandbun run test:changedwere not run (same host limitation and several worktrees sharing the machine); full coverage is left to CI.maintainer-sponsoredlabel: the hygiene gate flagssrc/server/auth-cors.ts. Everything else is ready for review.Checklist
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.