Repository navigation
fix(vertex): verified state follows the selected credential; probe forces a fresh exchange - #8836
Conversation
…probe forces a fresh exchange The dashboard marked an ambient Vertex row verified from an ADC token even when GOOGLE_CLOUD_API_KEY was set, so the row the adapter sends with an API key could read Ready. vertexCredentialVerified is now set only when the row's discovery selection is ADC, in that selection's marker scope. The static-catalog connection test reused the cached access token, so a revoked refresh credential kept testing ok for up to an hour. The probe now passes forceExchange, which skips the completed-token cache; inference and discovery keep it. Tests: the refused-exchange case no longer resets the cache before the refusal (which had already cleared the proof); it lets a short-lived token expire and refuses the refresh. The hard-lock refusal-read stub records the bearer it receives and asserts the stored-main bearer for the owned probe and the caller's own bearer for a caller-owned read.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
✅ Deterministic PR hygiene checks passed. |
|
Maintainer integration of #8836 at 18e3255. It fixes CodeRabbit threads PRRT_kwDOS-0Gi863wcEv, wcEy and wcE6 left on #8778, and x1up left on #8786.
|
Vertex ADC verification and per-family Antigravity rotation landed on dev (lidge-jun#8778, lidge-jun#8836); this merge takes dev's version of those files, drops the pool-kernel prefix sweep, and keeps only the account probe, Discover now and the account quota table. The quota table keeps dev's shared-login note.
Summary
Fixes four review findings left on the merged #8778 and #8786. All of them concern Vertex credential status or a credential path.
safeConfigDTOsetvertexCredentialVerifiedon ambient and marker rows from the ADC proof alone. WithGOOGLE_CLOUD_API_KEYset,selectVertexDiscoveryCredentialpicks that key for a keyless row, yet the row could still show Ready from an ADC token. The field is now set only when the row's selection is ADC, using that selection's marker scope. When the row uses the ambient API key, the field is absent and the row is not Ready.getVertexAccessTokenWithAuthority, which returns the cached token. A revoked refresh credential therefore kept testing ok for up to about 59 minutes. A newforceExchangeoption skips the completed-token cache; only the probe passes it, throughresolveVertexDiscoveryAuth. A forced probe still joins an exchange already in flight and refreshes the cache on success. A refused exchange clears the proof, while inference and discovery keep using the cache.__resetVertexTokenCache()before the refused exchange, which had already cleared the proof. It now mints a 120 s token, moves the clock past expiry minus the 60 s refresh skew, checks that the proof still stands, and then refuses the refresh without a reset.wham()stub now recordsinit.headers.authorization. Owned reads assert the stored-main bearer, including when the request carries an unrelated bearer. The caller-owned read asserts the caller's own bearer, which is a distinct placeholder token for the same account. All tokens are synthetic unsigned placeholders.structure/providers/google.mdand the en and esreference/adapters.mdnow describe the ADC-only verified state and the probe's fresh exchange.Verification
Each focused file was run under
/usr/bin/lockf -k /tmp/ocx-test.lockbecause this host is under heavy load.bun test tests/adapters/google/vertex-adc-verified.test.tson this branchsrc/reverted toorigin/dev(3ef14ad572)vertexCredentialVerifiedistrue) and the forced-probe case (second probe returns ok)verifiedSources.delete(scope)ingcp-adc.tsbun test tests/codex-integration/main-account-hard-lock-refusal-read.test.tsdevsource as well)tests/adapters/google/vertex-model-discovery.test.tstests/adapters/google/gcp-adc.test.tstests/adapters/google/gcp-sa-adapter.test.tstests/lab/core-lab-boundary.test.ts(auth-cors.tsnow imports the discovery selector)bun run typecheckbun run structure:checkbun run privacy:scanThe full suite (
bun run test) andbun run test:changedwere not run locally. The host is under heavy load and the brief limited this lane to focused single-file runs. Wider coverage is left to CI withci:full. No new test files were added, so the test-layout registration is unchanged. Every touched file is far below the 2,000-line cap, and none appears infile-size-baseline.json.Checklist
Summary by CodeRabbit