Skip to content

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 6, 2026

Summary

  • PR review loop's WAITING path now detects unresolved review threads from AI bots (Gemini Code Assist, etc.) that post as COMMENTED rather than CHANGES_REQUESTED
  • Previously, these reviews were invisible to the loop because GitHub's reviewDecision stayed NONE
  • Uses the existing check_unresolved_review_comments() GraphQL function, consistent with how the READY path already handles this

Problem

Bots like Gemini Code Assist submit reviews with state COMMENTED (not CHANGES_REQUESTED), so:

  1. GitHub's reviewDecision remains NONE
  2. The pr-loop enters the WAITING branch
  3. Feedback is never surfaced for the agent to act on
  4. The loop just waits and eventually triggers a CodeRabbit re-review

Fix

The WAITING branch now calls check_unresolved_review_comments() first. If unresolved threads exist, it surfaces the feedback via get_pr_feedback() with the standard AI verification warning. Only falls through to stale-review logic if no unresolved threads are found.

Files Changed

File Change
.agents/scripts/quality-loop-helper.sh Add unresolved thread check to WAITING path
.agents/scripts/commands/pr-loop.md Document new COMMENTED feedback detection

Summary by CodeRabbit

  • Bug Fixes

    • Improved detection and surfacing of unresolved AI feedback in pull request reviews, ensuring previously missed commented reviews are flagged for action.
  • Improvements

    • Review workflow now checks for unresolved review threads and API errors before auto-triggering re-reviews, adds warnings, and prompts verification of AI suggestions prior to proceeding.

…ING state

Bots like Gemini Code Assist post reviews as COMMENTED rather than
CHANGES_REQUESTED, so GitHub's reviewDecision stays NONE and the
pr-loop WAITING path never surfaced their feedback. Now checks for
unresolved review threads before falling through to stale-review
logic, consistent with how the READY path already handles this.
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, 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 improves the robustness of the automated PR review process by ensuring that feedback from AI reviewers, even when submitted with a 'COMMENTED' status, is no longer overlooked. By integrating a check for unresolved AI comments into the 'WAITING' state, the system now proactively surfaces this feedback, guiding developers to address relevant suggestions and enhancing the overall efficiency and thoroughness of code reviews.

Highlights

  • AI Feedback Detection: The PR review loop now correctly detects unresolved feedback from AI reviewers (e.g., Gemini Code Assist) that post comments with a 'COMMENTED' status, which was previously overlooked.
  • Improved WAITING State Logic: The 'WAITING' branch of the 'pr_review_loop' function has been updated to first check for unresolved AI review threads before proceeding with stale review logic.
  • Feedback Surfacing with Warning: When unresolved AI feedback is detected, it is surfaced to the user, accompanied by a warning to verify AI bot suggestions due to potential hallucinations.
  • Documentation Update: The 'pr-loop' command documentation has been updated to reflect the new capability of detecting 'COMMENTED' AI feedback.
Changelog
  • .agents/scripts/commands/pr-loop.md
    • Added a new entry under 'If issues are found' to document the detection of 'Unresolved AI feedback (COMMENTED)' and explain its implications.
  • .agents/scripts/quality-loop-helper.sh
    • Implemented a new check for unresolved AI review comments within the 'WAITING' state of the 'pr_review_loop' function.
    • Introduced logic to surface AI feedback and display a verification warning if unresolved 'COMMENTED' reviews are found.
    • Restructured the 'WAITING' state to prioritize AI feedback detection before initiating stale review re-triggers.
Activity
  • The pull request was authored by marcusquinn.
  • It introduces a fix to correctly surface AI reviewer feedback that is posted as 'COMMENTED' in the 'pr-loop''s 'WAITING' state.
  • The changes involve modifying a shell script responsible for the quality loop helper and updating its corresponding documentation.
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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 6, 2026

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically summarizes the main change: detecting and surfacing AI reviewer feedback posted as COMMENTED in the pr-loop WAITING state, which is the core fix this PR addresses.
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 docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bugfix/pr-loop-gemini-commented-feedback

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.

@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔍 Code Quality Report

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

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

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

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 24
  • VULNERABILITIES: 0

Generated on: Fri Feb 6 21:58:29 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 effectively addresses a gap in the PR review loop where feedback from AI bots posting with a COMMENTED status was being ignored. The solution to check for unresolved review threads within the WAITING state is logical and correctly implemented. The accompanying documentation update is also clear. I have one minor suggestion for the shell script to improve its conciseness.

Comment on lines 918 to 922
local waiting_unresolved_result
check_unresolved_review_comments "$pr_number"
waiting_unresolved_result=$?

if [[ $waiting_unresolved_result -eq 1 ]]; then

Choose a reason for hiding this comment

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

medium

For conciseness and to follow common shell scripting idioms, you can check the exit code ($?) directly in the if condition immediately after calling the function. This avoids the need for the intermediate waiting_unresolved_result local variable, making the code cleaner.

Suggested change
local waiting_unresolved_result
check_unresolved_review_comments "$pr_number"
waiting_unresolved_result=$?
if [[ $waiting_unresolved_result -eq 1 ]]; then
check_unresolved_review_comments "$pr_number"
if [[ $? -eq 1 ]]; then

Copy link
Owner Author

Choose a reason for hiding this comment

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

Dismissing: ShellCheck SC2181 recommends against if [[ $? -eq ... ]] and prefers capturing the exit code in a variable first, which is what we already do. The intermediate variable also makes the three-way branch (0/1/2) clearer.

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 @.agents/scripts/quality-loop-helper.sh:
- Around line 915-933: check the handling of the return code from
check_unresolved_review_comments: currently waiting_unresolved_result is only
compared to 1 and else treats 2 (API error) same as 0; update the branch to
explicitly test for return code 2 and log a caution (similar to the READY
handling) without triggering auto-trigger_review or re-review actions.
Specifically, after calling check_unresolved_review_comments (and setting
waiting_unresolved_result), add an explicit condition for
waiting_unresolved_result -eq 2 to call print_warning with an API-error message
and skip the auto_trigger_review/check_and_trigger_review path; keep the
existing behavior for -eq 1 and -eq 0 unchanged.

Address CodeRabbit feedback: when check_unresolved_review_comments
returns 2 (API error), log a caution warning instead of falling
through to stale-review trigger logic. Consistent with READY path
handling at lines 875-876.
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

🔍 Code Quality Report

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

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

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 6 22:02:44 UTC 2026: Code review monitoring started
Fri Feb 6 22:02:45 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 24
Fri Feb 6 22:02:45 UTC 2026: Qlty - 0 issues found, auto-formatting applied
Fri Feb 6 22:02:47 UTC 2026: Codacy analysis completed with auto-fixes

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 24
  • VULNERABILITIES: 0

Generated on: Fri Feb 6 22:02:50 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 6, 2026

@marcusquinn marcusquinn merged commit 6a2fa28 into main Feb 6, 2026
11 checks passed
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.

1 participant