Skip to content

feat: support multiple AI code reviewers in PR loop#295

Merged
alex-solovyev merged 6 commits intomainfrom
feature/294-multi-ai-reviewers
Feb 3, 2026
Merged

feat: support multiple AI code reviewers in PR loop#295
alex-solovyev merged 6 commits intomainfrom
feature/294-multi-ai-reviewers

Conversation

@alex-solovyev
Copy link
Collaborator

@alex-solovyev alex-solovyev commented Feb 3, 2026

Summary

  • Add regex-based detection for multiple AI code reviewers (CodeRabbit, Gemini Code Assist, Augment Code, GitHub Copilot)
  • Update PR loop to monitor comments from all supported AI reviewers
  • Add function to check for unresolved AI review comments

Problem

quality-loop-helper.sh only monitored CodeRabbit reviews, ignoring feedback from other AI code review services. This caused /pr-loop to miss review comments and declare "Ready to Merge" prematurely.

Evidence: In a managed project PR #2, Gemini Code Assist left comments that were not detected by the PR loop.

Changes

File Change
quality-loop-helper.sh Add AI_REVIEWERS constant with regex pattern
quality-loop-helper.sh Update get_pr_feedback() to detect all AI reviewer comments
quality-loop-helper.sh Update check_and_trigger_review() to check all AI reviewer times
quality-loop-helper.sh Add check_unresolved_review_comments() function
workflows/pr.md Document supported AI reviewers

Supported AI Reviewers

Reviewer Bot Username Pattern
CodeRabbit coderabbit*
Gemini Code Assist gemini-code-assist[bot]
Augment Code augment-code[bot]
GitHub Copilot copilot[bot]

Closes #294

Summary by CodeRabbit

  • New Features

    • PR review loop now monitors feedback from multiple AI code reviewers (CodeRabbit, Gemini Code Assist, Augment Code, GitHub Copilot) and surfaces their comments.
    • Detects unresolved AI reviewer comments and prevents auto-approval until feedback is addressed; will still warn if reviewer APIs cannot be reached.
  • Documentation

    • Added documentation describing supported AI reviewers and how the PR loop integrates their feedback.

Add regex-based detection for CodeRabbit, Gemini Code Assist, Augment
Code, and GitHub Copilot review comments. Previously only CodeRabbit
was monitored, causing /pr-loop to miss feedback from other AI reviewers.

Changes:
- Add AI_REVIEWERS constant with regex pattern
- Update get_pr_feedback() to detect all AI reviewer comments
- Update check_and_trigger_review() to check all AI reviewer times
- Add check_unresolved_review_comments() for detecting pending reviews
- Document supported AI reviewers in workflows/pr.md

Closes #294
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 3, 2026

Warning

Rate limit exceeded

@alex-solovyev has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 18 minutes and 38 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

Walkthrough

The PR extends the PR review loop to monitor multiple AI code reviewers (CodeRabbit, Gemini Code Assist, Augment Code, GitHub Copilot). It adds an AI_REVIEWERS constant, a check_unresolved_review_comments() function, and updates feedback collection and READY/approval logic to surface and block on unresolved AI reviewer comments.

Changes

Cohort / File(s) Summary
PR Loop Script Enhancement
.agent/scripts/quality-loop-helper.sh
Added AI_REVIEWERS regex constant; updated get_pr_feedback() to fetch comments from all configured AI reviewers; added check_unresolved_review_comments() (GraphQL/REST check for unresolved AI comments); updated check_and_trigger_review() and pr_review_loop() READY flow to consider AI reviewers and block approval when unresolved AI feedback exists. Note: duplicated insertion of READY-case unresolved-check appears in diff.
Documentation Update
.agent/workflows/pr.md
Documented supported AI reviewers and their bot patterns/purposes; noted that /pr-loop surfaces comments from all configured AI services.

Sequence Diagram(s)

sequenceDiagram
    participant PRLoop as PR Loop
    participant GH as GitHub API
    participant Unresolved as Unresolved Check
    participant Approver as Approver/PR Status

    PRLoop->>GH: Query PR comments/reviews using AI_REVIEWERS filter
    GH-->>PRLoop: Return AI reviewer comments & last review timestamp
    PRLoop->>Unresolved: check_unresolved_review_comments(pr_number)
    Unresolved->>GH: Query unresolved review comments for AI reviewers
    GH-->>Unresolved: Unresolved count/details

    alt Unresolved comments exist
        Unresolved-->>PRLoop: Return unresolved status
        PRLoop->>PRLoop: Fetch & display AI feedback, block approval
    else No unresolved comments
        Unresolved-->>PRLoop: Return clean status
        PRLoop->>Approver: Proceed with approval/READY actions
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🤖 A chorus of bots now watches every line,
CodeRabbit, Gemini, Copilot — all in a line.
No comment left murmur, no feedback ignored,
The PR loop listens, then closes the board. ✨

🚥 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 objective of the PR: adding support for multiple AI code reviewers in the PR loop instead of only CodeRabbit.
Linked Issues check ✅ Passed All requirements from issue #294 are met: regex-based AI_REVIEWERS constant, updated comment/review fetching, unresolved-comments check, and documentation updates are all implemented.
Out of Scope Changes check ✅ Passed All changes directly support the objective of adding multiple AI reviewer support; no unrelated modifications detected beyond the stated scope.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/294-multi-ai-reviewers

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 and usage tips.

@gemini-code-assist
Copy link

Summary of Changes

Hello @alex-solovyev, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the quality-loop-helper.sh script by extending its capability to monitor and incorporate feedback from a wider array of AI code review services. Previously limited to CodeRabbit, the system now integrates with Gemini Code Assist, Augment Code, and GitHub Copilot, ensuring that all AI-generated review comments and statuses are considered before a pull request is marked as ready for merge. This change addresses a critical issue where valuable AI feedback was being overlooked, leading to premature merges.

Highlights

  • Expanded AI Reviewer Support: The quality-loop-helper.sh script now recognizes and processes feedback from multiple AI code review services, including CodeRabbit, Gemini Code Assist, Augment Code, and GitHub Copilot, using a new regex pattern.
  • Enhanced PR Loop Monitoring: The PR loop's get_pr_feedback() and check_and_trigger_review() functions have been updated to incorporate comments and review times from all newly supported AI reviewers, preventing premature "Ready to Merge" states.
  • Unresolved Comment Detection: A new function, check_unresolved_review_comments(), has been introduced to identify and flag any outstanding comments from AI reviewers, ensuring all feedback is addressed before merging.
  • Documentation Update: The pr.md workflow documentation has been updated to list and describe the newly supported AI code reviewers, providing clarity on the system's capabilities.
Changelog
  • .agent/scripts/quality-loop-helper.sh
    • Introduced AI_REVIEWERS constant to define a regex pattern for supported AI bot usernames.
    • Modified get_pr_feedback to use the AI_REVIEWERS constant for detecting comments from all supported AI bots.
    • Updated check_and_trigger_review to track the last review time from any of the supported AI reviewers.
    • Added a new function check_unresolved_review_comments to count and report unresolved comments from AI reviewers.
  • .agent/workflows/pr.md
    • Added a new section "Supported AI Code Reviewers" detailing the integrated AI services and their bot username patterns.
Activity
  • The pull request was created by alex-solovyev to address the issue of quality-loop-helper.sh not detecting feedback from multiple AI code review services.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 406 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 3 05:01:24 UTC 2026: Code review monitoring started
Tue Feb 3 05:01:24 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 406
Tue Feb 3 05:01:24 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Tue Feb 3 05:01:26 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 406
  • VULNERABILITIES: 0

Generated on: Tue Feb 3 05:02:56 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request is a great enhancement, adding support for multiple AI code reviewers to the PR loop. The changes are well-structured, using a constant for the reviewer patterns and updating the relevant functions. However, I've identified a few areas for improvement. The regex for matching bot usernames is a bit too broad and could lead to false positives. More critically, the script currently suppresses API errors, which could cause the loop to incorrectly determine that a PR is ready to merge when there are unresolved comments. I've provided suggestions to make the regex more specific and to add explicit error handling for API calls. I also included a minor suggestion to improve the documentation.

Comment on lines 747 to 756
unresolved_count=$(gh api "repos/{owner}/{repo}/pulls/${pr_number}/comments" \
--jq --arg bots "$AI_REVIEWERS" \
'[.[] | select(.user.login | test($bots; "i")) | select(.in_reply_to_id == null)] | length' \
2>/dev/null || echo "0")

if [[ "$unresolved_count" -gt 0 ]]; then
print_warning "Found $unresolved_count unresolved AI review comments"
return 1
fi
return 0

Choose a reason for hiding this comment

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

critical

This command suppresses errors from the gh api call using 2>/dev/null and provides a default value of 0 using || echo "0". This is dangerous because if the API call fails for any reason (e.g., network issues, expired token), unresolved_count will become 0, and the function will incorrectly report that there are no unresolved comments. This could lead to a PR being merged while it still has pending AI feedback. The script should instead fail explicitly if the API call does not succeed and return a valid number.

Suggested change
unresolved_count=$(gh api "repos/{owner}/{repo}/pulls/${pr_number}/comments" \
--jq --arg bots "$AI_REVIEWERS" \
'[.[] | select(.user.login | test($bots; "i")) | select(.in_reply_to_id == null)] | length' \
2>/dev/null || echo "0")
if [[ "$unresolved_count" -gt 0 ]]; then
print_warning "Found $unresolved_count unresolved AI review comments"
return 1
fi
return 0
unresolved_count=$(gh api "repos/{owner}/{repo}/pulls/${pr_number}/comments" \
--jq --arg bots "$AI_REVIEWERS" \
'[.[] | select(.user.login | test($bots; "i")) | select(.in_reply_to_id == null)] | length' 2>/dev/null)
if ! [[ "$unresolved_count" =~ ^[0-9]+$ ]]; then
print_error "Error: Failed to retrieve unresolved comment count from GitHub API. Cannot proceed safely."
return 1
fi
if [[ "$unresolved_count" -gt 0 ]]; then
print_warning "Found $unresolved_count unresolved AI review comments"
return 1
fi
return 0


# AI code reviewers (regex pattern for jq test())
# Supported: CodeRabbit, Gemini Code Assist, Augment Code, GitHub Copilot
readonly AI_REVIEWERS="coderabbit|gemini-code-assist|augment-code|copilot"

Choose a reason for hiding this comment

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

high

The current regex pattern for AI_REVIEWERS is too broad. It performs a substring match because jq's test() function checks for containment when no anchors are used. This could incorrectly match usernames that simply contain the names of the bots (e.g., a user named john-copilot). This could lead to unintended behavior. The regex should be made more specific by using anchors (^, $) and escaping special characters to ensure only the intended bot usernames are matched.

Suggested change
readonly AI_REVIEWERS="coderabbit|gemini-code-assist|augment-code|copilot"
readonly AI_REVIEWERS="^coderabbit|^gemini-code-assist\\[bot\\]$|^augment-code\\[bot\\]$|^copilot\\[bot\\]$"

Comment on lines 649 to 652
ai_review_comments=$(gh api "repos/{owner}/{repo}/pulls/${pr_number}/comments" \
--jq --arg bots "$AI_REVIEWERS" \
'.[] | select(.user.login | test($bots; "i")) | "\(.user.login): \(.body)"' \
2>/dev/null | head -20 || echo "")

Choose a reason for hiding this comment

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

medium

The use of 2>/dev/null || echo "" suppresses any errors from the gh api call. If the API fails (e.g., due to network issues or an invalid token), the script will silently continue as if there were no comments, and no feedback will be displayed. While the consequence here is less severe than in other parts of the script, it's good practice to handle API errors explicitly to make debugging easier. Consider logging a warning if the API call fails.

|----------|---------------------|---------|
| CodeRabbit | `coderabbit*` | AI-powered code review with suggestions |
| Gemini Code Assist | `gemini-code-assist[bot]` | Google's AI code review |
| Augment Code | `augment-code[bot]` | Augment AI code review |

Choose a reason for hiding this comment

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

medium

The description for 'Augment Code' in the 'Purpose' column is tautological ('Augment AI code review'). A more descriptive explanation would be more helpful for readers to understand its function.

Suggested change
| Augment Code | `augment-code[bot]` | Augment AI code review |
| Augment Code | `augment-code[bot]` | AI-powered code review and improvement |

@augmentcode
Copy link

augmentcode bot commented Feb 3, 2026

🤖 Augment PR Summary

Summary: Expands the PR loop so it can surface feedback from multiple AI code review bots (not just CodeRabbit), reducing false “Ready to Merge” outcomes.

Changes:

  • Introduced an AI_REVIEWERS regex and applied it to PR comment parsing to detect CodeRabbit, Gemini Code Assist, Augment, and Copilot feedback
  • Updated stale-review detection to look at the most recent review from any supported AI reviewer
  • Added a check that blocks the READY state when AI review comments are still present
  • Documented the supported AI reviewer bot username patterns in the PR workflow docs

🤖 Was this summary useful? React with 👍 or 👎

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

# Get AI reviewer comments (CodeRabbit, Gemini Code Assist, Augment Code, Copilot)
local ai_review_comments
ai_review_comments=$(gh api "repos/{owner}/{repo}/pulls/${pr_number}/comments" \
--jq --arg bots "$AI_REVIEWERS" \
Copy link

Choose a reason for hiding this comment

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

gh api supports --jq, but it doesn’t accept additional jq flags like --arg; this will likely fail with an “unknown flag” error and (because of || echo "") silently drop AI reviewer feedback.

Severity: high

Other Locations
  • .agent/scripts/quality-loop-helper.sh:698
  • .agent/scripts/quality-loop-helper.sh:748

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

# Arguments: $1 - PR number
# Returns: 0 if no unresolved comments, 1 if unresolved comments exist
# Output: Warning message if unresolved comments found
check_unresolved_review_comments() {
Copy link

Choose a reason for hiding this comment

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

check_unresolved_review_comments is defined but not called anywhere in the PR loop, so it won’t currently prevent /pr-loop from reporting success even when AI review comments exist.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

local unresolved_count
unresolved_count=$(gh api "repos/{owner}/{repo}/pulls/${pr_number}/comments" \
--jq --arg bots "$AI_REVIEWERS" \
'[.[] | select(.user.login | test($bots; "i")) | select(.in_reply_to_id == null)] | length' \
Copy link

Choose a reason for hiding this comment

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

select(.in_reply_to_id == null) counts top-level review comments, not “unresolved” threads, so this may warn even after comments have been addressed/resolved in the GitHub UI.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

- Fix gh api --jq not supporting --arg flag by piping to jq
- Make AI_REVIEWERS regex more specific with anchors to prevent false positives
- Add explicit error handling for GitHub API calls
- Call check_unresolved_review_comments() in READY state before declaring merge-ready
- Improve Augment Code description in pr.md documentation
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 406 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 3 05:09:48 UTC 2026: Code review monitoring started
Tue Feb 3 05:09:48 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 406
Tue Feb 3 05:09:48 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Tue Feb 3 05:09:50 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 406
  • VULNERABILITIES: 0

Generated on: Tue Feb 3 05:11:16 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@alex-solovyev
Copy link
Collaborator Author

augment review

Copy link

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

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

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

if [[ -z "$api_response" ]]; then
print_warning "Failed to fetch PR comments from GitHub API"
else
ai_review_comments=$(echo "$api_response" | jq -r --arg bots "$AI_REVIEWERS" \
Copy link

Choose a reason for hiding this comment

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

api_response contains raw JSON; piping it through echo can mangle backslash escapes on some shells and lead to intermittent jq parse failures (which would make AI feedback appear “missing”). This same pattern appears in the review-time and unresolved-count parsing too.

Severity: medium

Other Locations
  • .agent/scripts/quality-loop-helper.sh:705
  • .agent/scripts/quality-loop-helper.sh:764

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

echo "<promise>PR_APPROVED</promise>"
return 0
# Check for unresolved AI review comments before declaring ready
if ! check_unresolved_review_comments "$pr_number"; then
Copy link

Choose a reason for hiding this comment

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

if ! check_unresolved_review_comments ... treats both “unresolved comments” (exit 1) and “API error” (exit 2) the same, so transient GitHub/gh failures will be reported as unresolved feedback and can prevent ever reaching the READY path. If you intend API errors to be a hard-stop, it may be worth distinguishing the 2 case explicitly.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

|----------|---------------------|---------|
| CodeRabbit | `coderabbit*` | AI-powered code review with suggestions |
| Gemini Code Assist | `gemini-code-assist[bot]` | Google's AI code review |
| Augment Code | `augment-code[bot]` | AI-powered code review and improvement |
Copy link

Choose a reason for hiding this comment

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

Docs list Augment as augment-code[bot], but the implementation also matches augmentcode[bot] (no dash). It’d be easy for users to get confused about which bot accounts are actually supported if the table doesn’t reflect both.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.agent/scripts/quality-loop-helper.sh:
- Around line 749-777: The function check_unresolved_review_comments currently
fetches PR comments via the REST endpoint and uses in_reply_to_id to infer
unresolved status; replace that REST call with a GitHub GraphQL query (using gh
api graphql) to fetch the pullRequest.reviewThreads.nodes and use each
node.isResolved to count unresolved threads for the given PR number. Update the
api_response handling in check_unresolved_review_comments to run a GraphQL query
for repository(owner:, name:) { pullRequest(number: $pr_number) {
reviewThreads(first: 100) { nodes { isResolved author { login } } } } }, filter
threads where isResolved == false and author.login matches entries in
$AI_REVIEWERS (case-insensitive), parse the count into unresolved_count,
preserve the same error checks and return codes (0/1/2) and warning message when
unresolved_count > 0. Ensure JSON parsing uses jq safely and retain existing
failure messages from print_error/print_warning.
🧹 Nitpick comments (2)
.agent/scripts/quality-loop-helper.sh (1)

647-661: Paginate AI comment fetch to avoid missing feedback.
gh api defaults to the first page; if a PR has >30 review comments, AI feedback can be missed and the loop may incorrectly proceed. Consider --paginate here.

♻️ Suggested change
-    api_response=$(gh api "repos/{owner}/{repo}/pulls/${pr_number}/comments" 2>/dev/null)
+    api_response=$(gh api "repos/{owner}/{repo}/pulls/${pr_number}/comments" --paginate 2>/dev/null)
.agent/workflows/pr.md (1)

100-112: Prefer a file:line reference to avoid doc drift.
This table mirrors script implementation and can stale; consider pointing to file:.agent/scripts/quality-loop-helper.sh:59-61 and a short sentence instead of inline details.

As per coding guidelines: “.agent/**/*.md: Apply progressive disclosure… use file:line references to point to actual implementation instead of inline code snippets.”

- Use printf instead of echo for JSON to prevent backslash escape issues
- Distinguish API errors (exit 2) from unresolved comments (exit 1) in READY handler
- Document both augment-code[bot] and augmentcode[bot] in pr.md
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 406 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 3 05:17:28 UTC 2026: Code review monitoring started
Tue Feb 3 05:17:29 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 406
Tue Feb 3 05:17:29 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Tue Feb 3 05:17:31 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 406
  • VULNERABILITIES: 0

Generated on: Tue Feb 3 05:18:58 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Replace REST in_reply_to_id check with GraphQL reviewThreads query.
The REST field only indicates if a comment is top-level, not whether
the thread is resolved. GraphQL isResolved field correctly reflects
the resolution status as shown in GitHub UI.
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 406 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 3 05:21:14 UTC 2026: Code review monitoring started
Tue Feb 3 05:21:15 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 406
Tue Feb 3 05:21:15 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Tue Feb 3 05:21:17 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 406
  • VULNERABILITIES: 0

Generated on: Tue Feb 3 05:22:44 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

SC2016 flags $owner, $repo, $number as unexpanded shell variables,
but they are GraphQL variables passed via -f/-F flags, not shell vars.
Single quotes are intentional to pass the literal query string.
@github-actions
Copy link

github-actions bot commented Feb 3, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 406 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 3 05:37:12 UTC 2026: Code review monitoring started
Tue Feb 3 05:37:12 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 406
Tue Feb 3 05:37:12 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Tue Feb 3 05:37:14 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 406
  • VULNERABILITIES: 0

Generated on: Tue Feb 3 05:38:43 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @.agent/scripts/quality-loop-helper.sh:
- Around line 749-793: The check_unresolved_review_comments function currently
counts all unresolved review threads but should only consider AI reviewer
threads; update the GraphQL selection to include comments' author login (add
comments { nodes { author { login } } } to the pullRequest.reviewThreads query)
and change the jq extraction (unresolved_count) to filter unresolved threads
where the first comment author login matches the AI reviewer pattern variable
($AI_REVIEWERS) using jq's test() (same pattern used elsewhere in this file),
ensuring unresolved_count uses that filtered length; keep references to
check_unresolved_review_comments, api_response, and $AI_REVIEWERS when making
the change.

Comment on lines +749 to +793
# Check for unresolved review threads on a PR using GraphQL
# Arguments: $1 - PR number
# Returns: 0 if no unresolved threads, 1 if unresolved threads exist, 2 on API error
# Output: Warning message if unresolved threads found
check_unresolved_review_comments() {
local pr_number="$1"

local repo_owner repo_name api_response unresolved_count
repo_owner=$(gh repo view --json owner -q '.owner.login' 2>/dev/null || echo "")
repo_name=$(gh repo view --json name -q '.name' 2>/dev/null || echo "")

if [[ -z "$repo_owner" || -z "$repo_name" ]]; then
print_error "Failed to resolve repo owner/name - cannot verify review status"
return 2
fi

# shellcheck disable=SC2016 # GraphQL variables, not shell - single quotes intentional
api_response=$(gh api graphql -f query='
query($owner:String!, $repo:String!, $number:Int!) {
repository(owner:$owner, name:$repo) {
pullRequest(number:$number) {
reviewThreads(first:100) { nodes { isResolved } }
}
}
}' -f owner="$repo_owner" -f repo="$repo_name" -F number="$pr_number" 2>/dev/null)

if [[ -z "$api_response" ]]; then
print_error "Failed to fetch PR review threads from GitHub API - cannot verify review status"
return 2
fi

unresolved_count=$(printf '%s' "$api_response" | jq -r \
'[.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false)] | length' 2>/dev/null)

if ! [[ "$unresolved_count" =~ ^[0-9]+$ ]]; then
print_error "Failed to parse unresolved thread count - cannot proceed safely"
return 2
fi

if [[ "$unresolved_count" -gt 0 ]]; then
print_warning "Found $unresolved_count unresolved review threads"
return 1
fi
return 0
}
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

# Get broader context around the function
head -n 800 .agent/scripts/quality-loop-helper.sh | tail -n +730 | cat -n

# Search for references to AI_REVIEWERS in the file
rg -n "AI_REVIEWERS" .agent/scripts/quality-loop-helper.sh -B 2 -A 2

# Search for any comments about unresolved review filtering
rg -n "unresolved" .agent/scripts/quality-loop-helper.sh -B 3 -A 3

Repository: marcusquinn/aidevops

Length of output: 6409


Filter unresolved threads by AI reviewer author to match stated intent.

The function checks for unresolved review threads from any source, but the calling context (line 869) and comment state "Check for unresolved AI review comments." Other functions in this file filter by $AI_REVIEWERS using jq's test() function—apply the same pattern here.

Update the GraphQL query to include comments { nodes { author { login } } } and filter the jq selection to exclude non-AI reviewers, matching the behavior at lines 654-655 and 705-706:

[.data.repository.pullRequest.reviewThreads.nodes[] | select(.isResolved == false and (.comments.nodes[0].author.login | test($bots; "i")))] | length

This ensures the automation only blocks on AI reviewer feedback, maintaining the intended gate before marking PRs as ready.

🤖 Prompt for AI Agents
In @.agent/scripts/quality-loop-helper.sh around lines 749 - 793, The
check_unresolved_review_comments function currently counts all unresolved review
threads but should only consider AI reviewer threads; update the GraphQL
selection to include comments' author login (add comments { nodes { author {
login } } } to the pullRequest.reviewThreads query) and change the jq extraction
(unresolved_count) to filter unresolved threads where the first comment author
login matches the AI reviewer pattern variable ($AI_REVIEWERS) using jq's test()
(same pattern used elsewhere in this file), ensuring unresolved_count uses that
filtered length; keep references to check_unresolved_review_comments,
api_response, and $AI_REVIEWERS when making the change.

Codacy and similar tools return ACTION_REQUIRED when issues are found,
not FAILURE. Previously this was ignored, allowing PR to be marked READY
while quality issues remained. Now ACTION_REQUIRED blocks like FAILURE.
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 3, 2026

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 406 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Tue Feb 3 05:43:34 UTC 2026: Code review monitoring started
Tue Feb 3 05:43:34 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 406
Tue Feb 3 05:43:35 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Tue Feb 3 05:43:37 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 406
  • VULNERABILITIES: 0

Generated on: Tue Feb 3 05:44:52 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

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.

feat: support multiple AI code reviewers in PR loop (Gemini, Augment, Copilot)

1 participant