feat(commands): add Antigravity reviewer to Santa loop - #2768
Conversation
…tion Santa-loop's Reviewer B only tried codex and gemini before falling back to a same-family Claude reviewer, losing model diversity when neither was installed. Detect agy (Antigravity CLI, ~/.local/bin/agy) as a third option, using gemini-3.6-flash-high — despite the "flash" name, it currently outranks gemini-3.1-pro-high on every published coding/agentic benchmark (SWE-Bench Pro, Terminal-Bench, MLE-Bench), with Pro only ahead on PhD-level reasoning benchmarks that don't apply to code review. Also documents never pointing agy at a Claude model, which would collapse Reviewer A/B model diversity entirely.
📝 WalkthroughSummary by CodeRabbit
WalkthroughSanta Loop now detects an installed Antigravity wrapper and uses it after Codex and Gemini. The wrapper receives the maintained reviewer role and selects the model. Claude remains the final fallback. Documentation describes provider diversity and restricted execution paths. ChangesReviewer backend fallback
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant SantaLoop
participant Codex
participant Gemini
participant AntigravityCCG
participant Claude
SantaLoop->>Codex: Try reviewer backend
SantaLoop->>Gemini: Try reviewer backend if Codex is unavailable
SantaLoop->>AntigravityCCG: Submit reviewer role if Codex and Gemini are unavailable
AntigravityCCG-->>SantaLoop: Select model and return review
SantaLoop->>Claude: Use fallback if all prior backends are unavailable
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
commands/santa-loop.md (2)
79-90: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winRoute unusable Antigravity sessions to Claude.
If the wrapper is executable but the backend or
reviewer.mdrole file is unavailable, the current selection logic still chooses Antigravity and does not invoke Claude. Validate these prerequisites and fall back when startup fails.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@commands/santa-loop.md` around lines 79 - 90, Update the Antigravity selection logic around the codeagent-wrapper executable check to also validate backend availability and the reviewer.md role file before selecting Antigravity. If those prerequisites are missing or Antigravity startup fails, fall back to invoking Claude while preserving the existing CLI preference order.
79-115: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick winAdd a focused static contract test for
/santa-loop.Test CLI priority,
ROLE_FILEinput, Codex read-only mode, structured JSON, and prompt-file cleanup. Define fallback behavior when a selected CLI or wrapper exits nonzero; the current instructions stop after the failed CLI. Add cleanup for the Claude fallback. Do not require real model calls or unit, integration, and end-to-end tests for this Markdown-only command.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@commands/santa-loop.md` around lines 79 - 115, Add a focused static contract test for the /santa-loop instructions that verifies CLI priority, ROLE_FILE propagation, Codex read-only execution, structured JSON handling, and cleanup of PROMPT_FILE. Specify behavior when an available Codex, Gemini, or Antigravity command exits nonzero, and ensure execution proceeds or fails explicitly according to the defined fallback policy. Add PROMPT_FILE cleanup to the Claude Agent fallback, without introducing real model calls or broader test suites.Source: Coding guidelines
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@commands/santa-loop.md`:
- Around line 115-116: Ensure the temporary prompt file created by mktemp is
cleaned up on every backend path, including the Claude fallback. Add an exit and
signal trap immediately after PROMPT_FILE is created, using the existing
PROMPT_FILE variable, and remove redundant branch-specific cleanup if necessary.
Review the trap for secret exfiltration and sensitive temporary-artifact
handling.
---
Outside diff comments:
In `@commands/santa-loop.md`:
- Around line 79-90: Update the Antigravity selection logic around the
codeagent-wrapper executable check to also validate backend availability and the
reviewer.md role file before selecting Antigravity. If those prerequisites are
missing or Antigravity startup fails, fall back to invoking Claude while
preserving the existing CLI preference order.
- Around line 79-115: Add a focused static contract test for the /santa-loop
instructions that verifies CLI priority, ROLE_FILE propagation, Codex read-only
execution, structured JSON handling, and cleanup of PROMPT_FILE. Specify
behavior when an available Codex, Gemini, or Antigravity command exits nonzero,
and ensure execution proceeds or fails explicitly according to the defined
fallback policy. Add PROMPT_FILE cleanup to the Claude Agent fallback, without
introducing real model calls or broader test suites.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 867db2e6-1ce0-4ae1-acbd-62b9a4fe6e93
📒 Files selected for processing (1)
commands/santa-loop.md
📜 Review details
⏰ Context from checks skipped due to timeout. (4)
- GitHub Check: Greptile Review
- GitHub Check: Test (windows-latest, Node 22.x, npm)
- GitHub Check: Coverage
- GitHub Check: Python Tests
🧰 Additional context used
📓 Path-based instructions (5)
commands/**/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
Commands should be formatted as Markdown with description frontmatter.
Files:
commands/santa-loop.md
{agents,skills,commands}/**/*.md
📄 CodeRabbit inference engine (CLAUDE.md)
Use lowercase filenames with hyphens (e.g.,
python-reviewer.md,tdd-workflow.md) for agents, skills, and commands.
Files:
commands/santa-loop.md
**/*
📄 CodeRabbit inference engine (AGENTS.md)
**/*: Delegate complex, domain-specific, architectural, security-sensitive, review, build, and testing tasks to the appropriate specialized agent; use parallel execution for independent operations.
For new features and bug fixes, follow TDD: write a failing test first, implement the minimum solution, then refactor and verify coverage.
Maintain at least 80% test coverage and provide unit, integration, and end-to-end tests, including critical user flows.
Never compromise security: validate all inputs, prevent SQL injection with parameterized queries, sanitize HTML against XSS, enable CSRF protection, verify authentication and authorization, rate-limit endpoints, and avoid leaking sensitive data in errors.
Never hardcode API keys, passwords, tokens, or other secrets; use environment variables or a secret manager, validate required secrets at startup, and rotate exposed secrets immediately.
If a security issue is found, stop, use the security-reviewer agent, fix critical issues, rotate exposed secrets, and review the codebase for similar issues.
Always create new objects and return new copies with changes applied; never mutate existing objects.
Organize code into many small, focused files by feature or domain rather than by type; target 200–400 lines and keep files below 800 lines where practical.
Handle errors at every level, show user-friendly messages in UI code, log detailed context server-side, and never silently swallow errors.
Validate all external and user input at system boundaries using schema-based validation; fail fast with clear messages and never trust external data.
Keep functions under 50 lines, files focused and under 800 lines, avoid nesting deeper than four levels, avoid hardcoded values, and use readable, well-named identifiers.
Plan complex features before implementation, identifying dependencies and risks and breaking work into phases.
After modifying code, run code review immediately and address critical and high-severity issues.
Store personal ...
Files:
commands/santa-loop.md
commands/**
📄 CodeRabbit inference engine (AGENTS.md)
Treat
commands/as a legacy slash-entry compatibility surface and add or update commands only when a migration or cross-harness shim is required.
Files:
commands/santa-loop.md
{skills,commands,agents,rules}/**
⚙️ CodeRabbit configuration file
{skills,commands,agents,rules}/**: Focus on prompt-injection resilience, tool-permission scope, destructive action guards, and secret exfiltration risks.
Files:
commands/santa-loop.md
🔇 Additional comments (1)
commands/santa-loop.md (1)
104-115: 🔒 Security & PrivacyVerify the Antigravity permission boundary.
The Codex call explicitly requests
--sandbox read-only. The Antigravity call passes only the backend, prompt stream, and working directory. This file does not enforce or verify read-only filesystem access, command restrictions, network restrictions, or secret protection. If the wrapper defaults are permissive, prompt injection in reviewed files can cause destructive actions or data exfiltration. Confirm the CCG wrapper contract and add a supported read-only or no-write restriction at this boundary. The documentation must not claim a restricted path until that guarantee is verified. (github.com)As per path instructions, files under
{skills,commands,agents,rules}/**require review of prompt-injection resilience, tool-permission scope, destructive action guards, and secret exfiltration risks.Also applies to: 181-183
Source: Path instructions
| **Claude Agent fallback** (only if Codex, Gemini, and the Antigravity wrapper are unavailable) | ||
| Launch a second Claude Agent (subagent_type: `code-reviewer`, model: `opus`). Log a warning that both reviewers share the same model family — true model diversity was not achieved but context isolation is still enforced. |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
Clean up PROMPT_FILE on the Claude fallback path.
The prompt file is created before backend selection. The Codex, Gemini, and Antigravity branches remove it, but the Claude fallback has no corresponding cleanup. Install an exit trap immediately after mktemp, such as trap 'rm -f -- "$PROMPT_FILE"' EXIT HUP INT TERM, instead of relying on each backend branch.
As per path instructions, this command requires review for secret exfiltration and sensitive temporary artifacts.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@commands/santa-loop.md` around lines 115 - 116, Ensure the temporary prompt
file created by mktemp is cleaned up on every backend path, including the Claude
fallback. Add an exit and signal trap immediately after PROMPT_FILE is created,
using the existing PROMPT_FILE variable, and remove redundant branch-specific
cleanup if necessary. Review the trap for secret exfiltration and sensitive
temporary-artifact handling.
Source: Path instructions
|
Thanks for tracking this down — I didn't know about the CCG wrapper contract ( Also just enabled maintainer edits on my open PR branches (this one's source and #2647) so future adjustments like this can land directly instead of needing a parallel PR. |
Closes #2646.
This keeps the original contribution and Santa-loop Antigravity reviewer support while aligning it with the supported ECC CCG integration contract:
codeagent-wrapper--backend antigravitythrough that wrapperCredit to @Or4cu1o for the feature and implementation direction in #2646. I carried the patch onto a maintainer branch because that fork does not allow maintainer edits.
Validated locally with:
npx markdownlint-cli2 commands/santa-loop.mdnode scripts/ci/validate-commands.jsgit diff --check