Skip to content

feat(ci): AI-to-AI review loop — auto-address CodeRabbit reviews before merge #2266

Closed

Description

@zackees

Summary

When CodeRabbit posts review comments on a PR, the AI agent pushing code should automatically:

  1. Read all CodeRabbit review comments
  2. Evaluate each finding against the actual code
  3. Fix valid issues and push a new commit
  4. Reply to each comment acknowledging the fix or explaining why it's not needed
  5. Only then attempt to merge

This creates an AI-to-AI review loop — one AI reviews, another addresses feedback — ensuring higher code quality without human bottleneck.

Current enforcement (already configured)

  • .coderabbit.yaml with request_changes_workflow: true — CodeRabbit submits REQUEST_CHANGES until resolved
  • Branch protection: 1 required approval + dismiss stale reviews + required conversation resolution
  • Gap: AI agents currently try to merge without reading/addressing CodeRabbit feedback

Desired behavior

Pre-merge check

Before any gh pr merge, check for unresolved review comments. If found, block merge and address them first.

Auto-address workflow

  1. Fetch review comments via gh api repos/{owner}/{repo}/pulls/{pr}/comments
  2. Classify each: valid fix needed | style preference (acknowledge) | false positive (explain)
  3. Apply fixes for valid issues
  4. Reply to each comment thread to mark resolved
  5. Push commit: fix: address CodeRabbit review feedback

Implementation options

  • Claude Code skill (/address-reviews) — manually invocable
  • Claude Code hook (PreToolUse on gh pr merge) — auto-blocks and suggests addressing
  • GitHub Action — triggers AI agent after CodeRabbit posts reviews

Safety

  • Max iteration limit on the review loop (prevent infinite cycles)
  • Critical/security findings flag a human, not auto-fixed
  • Transparent commit messages explaining what was changed and why

Applies to

All FastLED org repos: FastLED/FastLED, FastLED/fbuild, and any future repos.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions