Repository navigation
fix(antigravity): rotate an auth-failed 403 only under Google's PERMISSION_DENIED enum - #8835
Conversation
…SSION_DENIED enum
classifyGoogle wrote the bare 'Antigravity authentication failed' prefix for any
403 whose text said expired/unauthenticated, and hasAntigravityAccessDeniedMarker
accepted that prefix, so an enum-less 403 (a proxy page saying 'Session expired',
or {error:{message:'Token expired'}}) walked the pool and cooled every account.
The auth-failed prefix now carries the (PERMISSION_DENIED) suffix only when the
enum was parsed, and the marker requires it.
Also correct the structure doc: the shared sibling-attempt guard admits the 401
hop and the validation 403 only.
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 #8835 at 9ba603f. It fixes CodeRabbit threads PRRT_kwDOS-0Gi863wzS1 and PRRT_kwDOS-0Gi863wcE5, left on the merged #8778.
|
Summary
Addresses CodeRabbit review threads
PRRT_kwDOS-0Gi863wzS1andPRRT_kwDOS-0Gi863wcE5on #8778.An Antigravity 403 without Google's structured
error.status: "PERMISSION_DENIED"could still walk the account pool and cool each account for 60 seconds. This happened when its text said "expired", "unauthenticated" or "invalid authentication".classifyGooglenormalized such a body to the bareAntigravity authentication failedprefix, andhasAntigravityAccessDeniedMarkeraccepted that prefix. A proxy page saying "Session expired", or{"error":{"message":"Token expired"}}, therefore rotated through every account. That broke the module's own contract and the documented promise that a 403 Google did not markPERMISSION_DENIEDkeeps its error and cools nothing.src/adapters/google-errors.ts: the auth-failed prefix now keeps(PERMISSION_DENIED)(newGOOGLE_PERMISSION_DENIED_SUFFIX) only when the parsed envelope carried that enum, mirroring the existing access-denied branch. Downstream substring matching on "authentication failed" is unchanged.src/server/responses/antigravity-validation-refusal.ts: the marker accepts the auth-failed alternative only with that suffix. The structuredPERMISSION_DENIEDauth-failed case still rotates and cools; the raw web-search sidecar path goes through the same normalizer and gets the same rule.structure/transports/responses-failover.md: the shared sibling-attempt guard (antigravityAuthRotationAttempted) admits only the 401 hop and theVALIDATION_REQUIRED403 hop. Access denial repeats up to the failover limit, and the 5xx hop has its own single-hop guard. The doc said "the 401 and 403 paths share one guard", which contradicted the access-denied pool-walk test.Verification
Regression tests (focused, single file under
/usr/bin/lockf -k /tmp/ocx-test.lock):tests/server/server-google-antigravity-oauth-401-replay.test.ts: new enum-less "Token expired" envelope and "Session expired" HTML cases must not rotate or cool. On origin/dev 3ef14ad: 65 pass / 2 fail (both new cases). With the fix: 67 pass / 0 fail. A new structuredPERMISSION_DENIED"Token expired" case still rotates and cools (passes before and after).tests/adapters/google/google-vertex-http.test.ts: the marker and the raw sidecar predicate reject the enum-less normalized text. On origin/dev: 57 pass / 1 fail. With the fix: 58 pass / 0 fail.google-errors,server-antigravity-web-search-validation,server-antigravity-verify-replay-scope,server-antigravity-model-denial-recovery,server-google-antigravity-oauth-429-budget,error-fidelity,acl-error-classification,web-search-recovery-kind,docs-429-failover-claims,docs-developer-role-policy,structure-ssot.bun run typecheck,bun run structure:check,bun run privacy:scan: pass.NOT RUN: full
bun run testandtest:changedlocally. The host is under heavy load and this lane is limited to focused single-file runs. Broader coverage is left to CI (ci:full).Checklist
Summary by CodeRabbit
Bug Fixes
PERMISSION_DENIED. Other 403 errors—including those mentioning expired sessions or tokens—retain their original error and do not cool down an account.Documentation