Skip to content

feat(commands): add Antigravity reviewer to Santa loop - #2768

Open
haelyra wants to merge 3 commits into
mainfrom
maint/pr-2646-antigravity-wrapper
Open

feat(commands): add Antigravity reviewer to Santa loop#2768
haelyra wants to merge 3 commits into
mainfrom
maint/pr-2646-antigravity-wrapper

Conversation

@haelyra

@haelyra haelyra commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Closes #2646.

This keeps the original contribution and Santa-loop Antigravity reviewer support while aligning it with the supported ECC CCG integration contract:

  • detects the installed codeagent-wrapper
  • invokes --backend antigravity through that wrapper
  • leaves model selection to the maintained backend contract
  • retains the original reviewer priority and fallback behavior

Credit 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.md
  • node scripts/ci/validate-commands.js
  • git diff --check

Or4cu1o and others added 3 commits July 31, 2026 20:53
…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.
@haelyra
haelyra requested a review from affaan-m as a code owner August 11, 2026 17:39
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Added support for Antigravity as an automated review provider.
    • Reviewers now prioritize available providers and fall back to an alternate Claude review when needed.
    • Updated review guidance to reflect provider diversity and restricted execution paths.

Walkthrough

Santa 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.

Changes

Reviewer backend fallback

Layer / File(s) Summary
Backend detection and fallback order
commands/santa-loop.md
Santa Loop detects the Antigravity executable and documents the ordered Codex, Gemini, Antigravity, and Claude fallback sequence.
Antigravity execution and documentation
commands/santa-loop.md
The Antigravity path uses the CCG wrapper’s maintained role contract, delegates model selection, removes the temporary prompt, and documents provider diversity and restricted execution paths.

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
Loading

Suggested reviewers: affaan-m

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: adding an Antigravity reviewer to the Santa loop.
Description check ✅ Passed The description directly explains the Antigravity wrapper integration, reviewer order, fallback behavior, and validation performed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch maint/pr-2646-antigravity-wrapper

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.

@greptile-apps

greptile-apps Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This change adds Antigravity as an optional second-reviewer backend in Santa Loop. The new path references the CCG wrapper and Antigravity reviewer role, but the command does not tell users that npx ccg-workflow provisions those external files. Add the prerequisite near the reviewer availability check or Antigravity instructions so users can enable and troubleshoot the backend.

Confidence Score: 4/5

The documentation change should not be merged until the Antigravity setup prerequisite is documented, because otherwise users cannot discover how to provision the required external runtime.

A focused executable comparison confirmed that Santa Loop references the wrapper and reviewer role while omitting the provisioning command documented by the sibling workflow.

Files Needing Attention: commands/santa-loop.md needs a CCG provisioning note before the availability detection or Antigravity backend section.

T-Rex T-Rex Logs

What T-Rex did

  • T-Rex produced proof for a posted P2 finding.
  • T-Rex produced proof for a second posted P2 finding.
  • T-Rex ran the requested contract validation, but local artifact references were not uploaded.

T-Rex Ran code and verified through T-Rex

Comments Outside Diff (2)

  1. commands/santa-loop.md, line 75-110 (link)

    P2 CCG provisioning prerequisite is undocumented

    Santa Loop checks for $HOME/.claude/bin/codeagent-wrapper and invokes it with $HOME/.claude/.ccg/prompts/antigravity/reviewer.md, but never tells users how those externally provisioned files are installed. commands/multi-workflow.md documents that npx ccg-workflow provisions the wrapper and role files. Add the same prerequisite before availability detection or the Antigravity section so users can enable and troubleshoot this reviewer backend.

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

    T-Rex Ran code and verified through T-Rex

  2. General comment

    P2 Santa Loop omits the CCG runtime provisioning prerequisite

    • Bug
      • commands/santa-loop.md lines 79 and 106-110 require $HOME/.claude/bin/codeagent-wrapper and $HOME/.claude/.ccg/prompts/antigravity/reviewer.md, but lines 75-116 never tell users that npx ccg-workflow provisions those dependencies. In contrast, commands/multi-workflow.md:9 explicitly states that the external runtime must be initialized with npx ccg-workflow to provision the wrapper and role files.
    • Cause
      • The Antigravity integration was added as an optional reviewer backend without carrying forward the prerequisite documentation used by sibling wrapper-based commands.
    • Fix
      • Add a prerequisite note before the CLI detection block (line 75) or Antigravity backend block (line 104) stating that ccg-workflow is external to the base install and that users must run npx ccg-workflow to provision ~/.claude/bin/codeagent-wrapper and ~/.claude/.ccg/prompts/* role files.

    T-Rex Ran code and verified through T-Rex

Reviews (1): Last reviewed commit: "fix(commands): route Santa reviewer thro..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Route unusable Antigravity sessions to Claude.

If the wrapper is executable but the backend or reviewer.md role 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 win

Add a focused static contract test for /santa-loop.

Test CLI priority, ROLE_FILE input, 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

📥 Commits

Reviewing files that changed from the base of the PR and between 74ffba6 and d73009b.

📒 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 & Privacy

Verify 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

Comment thread commands/santa-loop.md
Comment on lines +115 to 116
**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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 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

@Or4cu1o

Or4cu1o commented Aug 11, 2026

Copy link
Copy Markdown

Thanks for tracking this down — I didn't know about the CCG wrapper contract (codeagent-wrapper --backend antigravity) when I opened #2646, so pinning agy's model directly was the wrong call. Routing through the wrapper and letting it own model selection is the right fix, and I appreciate you keeping the original patch and credit intact. Happy for this to supersede #2646 whenever it merges.

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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants