Skip to content

fix(antigravity): enforce one sibling rotation across authentication failures - #6372

Merged
lidge-jun merged 4 commits into
devfrom
fix/luvs01-679-antigravity-auth-rotation-20261001
Oct 1, 2026
Merged

lidge-jun merged 4 commits into
devfrom
fix/luvs01-679-antigravity-auth-rotation-20261001

Conversation

@luvs01

@luvs01 luvs01 commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

An Antigravity request that already rotated after a structured VALIDATION_REQUIRED 403 could rotate again after the sibling returned 401 and its refresh failed terminally. Apply the existing one-sibling authentication rotation limit to that terminal-refresh branch as well. The regression covers A returning 403, B failing authentication refresh, and C never being sent the request.

Source history is preserved through commit 6d311240c3db7086b20597aacc3782795971d41a. The local validation below used the integration with dev at 0328373fb88fe0d019b29ae278e153d7fed4bcc7.

Verification

Current upstream integration: a6114b62ed1b65dede802359ccd373d913979b24; published HEAD 83355c9cd3e51436d3aa46dee41c000e53ddb7d4. The source history through 6d311240c3db7086b20597aacc3782795971d41a is retained without rewriting authors or commits. The PR-specific change was checked again after this integration; typecheck, structure, privacy and file-size gates passed. Cross-platform CI succeeded for this exact HEAD; its checkout tree matches the published HEAD tree. Skipped jobs remain skipped.

Windows, Bun 1.4.0, isolated test temporary directory:

  • bun test tests/oauth/generic-oauth-failover.test.ts --test-name-pattern "^Antigravity authentication refusal selection": 5 passed, 57 filtered, 0 failed, 10 assertions. Only the synthetic authentication-refusal selection cases ran in this maintenance pass; the full server regression file was not rerun.
  • bun node_modules/typescript/bin/tsc --noEmit: passed.
  • bun scripts/structure-ssot.ts: passed.
  • bun scripts/privacy-scan.ts: passed.
  • bun scripts/file-size-ratchet.ts: passed.
  • git diff --cached --check 0328373fb88fe0d019b29ae278e153d7fed4bcc7: passed.

The full local suite and test:changed were not run under the focused-validation exception. The broad OAuth file includes paths outside this synthetic selection scope, so only the named five cases ran; no provider refresh or real credentials were used. Exact-HEAD CI succeeded; results from another HEAD are not its verification.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Relevant contracts and regression coverage are recorded with the change.
  • Security-sensitive changes have independent maintainer review; sponsorship is required before merge where the sponsored-surface gate applies.
  • Author validation is documented for 83355c9cd3e51436d3aa46dee41c000e53ddb7d4, known correct findings are addressed, and exact-HEAD CI is complete; author review readiness is confirmed.

Independent maintainer approval, explicit security review, and any required maintainer-sponsored decision remain pending before merge. These are separate from author review readiness; no approval or sponsorship is claimed.

Summary by CodeRabbit

  • Bug Fixes

    • Prevented repeated account rotation after an Antigravity authentication refresh fails, avoiding an additional recovery attempt.
  • Tests

    • Added coverage confirming a terminal refresh failure returns an authentication error without trying another account.

@coderabbitai

coderabbitai Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

🧰 Additional context used
📚 Code guidelines (1)
src/AGENTS.md — auto-discovered

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 4e0594e5-c7a6-4ac3-9212-d6c3ce620e2e

📥 Commits

Reviewing files that changed from the base of the PR and between a6114b6 and 83355c9.

📒 Files selected for processing (2)
  • src/server/responses/adapter-dispatch.ts
  • tests/server/server-google-antigravity-oauth-401-replay.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

The Antigravity terminal-refresh failure path now records an account-rotation attempt before rotating. A regression test verifies that a later refresh failure returns 401 without trying a third account.

Changes

Antigravity account rotation

Layer / File(s) Summary
Guard refresh-failure rotation
src/server/responses/adapter-dispatch.ts, tests/server/server-google-antigravity-oauth-401-replay.test.ts
The terminal-refresh failure branch checks and sets the rotation-attempt guard. The regression test verifies a 401 response, requests using only the original and sibling account credentials and projects, and exactly one refresh attempt.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 83355

A terminal refresh failure after a sibling rotation returns 401 without trying another account. The inspected change and regression-test assertions match that behavior, with no actionable merge blocker identified.

Architecture Summary

Architecture risk: 🔵 Low · up to 83355

The change affects 2 systems.

Changed systems: src, tests

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — src (service) was modified; 1 changed file maps to changed impact.
  • observed — tests (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in src/server/responses/adapter-dispatch.ts: The Antigravity terminal-refresh failure branch now checks that rotation has not already been attempted and marks it attempted before proceeding; previously, the branch could rotate without setting the guard used by the later 401 recovery path.
  • observed — Modified behavior in tests/server/server-google-antigravity-oauth-401-replay.test.ts: Adds a test for validation-403 rotation followed by a sibling’s terminal refresh failure. It expects a 401 response, requests only with the original and sibling credentials and their paired projects, and one refresh attempt despite a third account being available.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: limiting Antigravity sibling-account rotation to one attempt across authentication failure paths.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Oct 1, 2026
@luvs01
luvs01 marked this pull request as ready for review October 1, 2026 09:11
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@lidge-jun

Copy link
Copy Markdown
Owner

Maintainer integration record (MAINTAINERS.md, dev-only) — draft by release lane L2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants