t5559: fix auto-decline safety-net to check any non-bot user comment#5576
t5559: fix auto-decline safety-net to check any non-bot user comment#5576marcusquinn wants to merge 1 commit intomainfrom
Conversation
The safety-net auto-decline logic (t5520) was filtering comments to only
those from the authenticated agent user (`${username}`), then excluding
bots. This meant a comment from any *other* human user was invisible to
the check, causing incorrect auto-declines when a non-agent user had
already engaged on the issue.
Remove the username equality filter; keep only the bot-exclusion test so
the guard correctly fires when *any* non-bot user has commented.
Fixes #5559 (Gemini review feedback from PR #5522)
|
Important Review skippedAuto reviews are limited based on label configuration. 🚫 Review skipped — only excluded labels are configured. (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
Summary of ChangesHello, 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 addresses a bug in the auto-decline safety-net mechanism that was causing issues to be incorrectly auto-declined. The fix involves refining the logic used to detect user comments, ensuring that any human interaction, not just that of the authenticated agent, is recognized. This prevents the system from prematurely closing issues due to a misinterpretation of user engagement. Highlights
Using Gemini Code AssistThe 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
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 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. Footnotes
|
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Mon Mar 23 18:53:50 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
There was a problem hiding this comment.
Code Review
This pull request modifies the draft-response-helper.sh script to remove the filtering of comments by a specific username, allowing all non-bot comments to be considered. The review suggests an improvement to the bot detection logic, recommending the use of user.type != "Bot" from the GitHub API for more robust identification of bot accounts, as it is more reliable than relying on a [bot] suffix in the username.
| local sa_comments | ||
| sa_comments=$(gh api --paginate "repos/${slug}/issues/${sa_issue_number}/comments?per_page=100" \ | ||
| --jq "[.[] | select(.user.login == \"${username}\") | select(.user.login | test(\"\\\\[bot\\\\]\$\"; \"i\") | not)]" \ | ||
| --jq "[.[] | select(.user.login | test(\"\\\\[bot\\\\]\$\"; \"i\") | not)]" \ |
There was a problem hiding this comment.
While this change correctly removes the filter for the specific agent's username, the bot detection can be made more robust. Instead of relying on the [bot] suffix in the username, you can use the user.type field provided by the GitHub API. This is a more reliable way to identify bot accounts, as not all bots may follow the [bot] naming convention.
| --jq "[.[] | select(.user.login | test(\"\\\\[bot\\\\]\$\"; \"i\") | not)]" \ | |
| --jq '[.[] | select(.user.type != "Bot")]' \ |
🔍 Code Quality Report�[0;35m[MONITOR]�[0m Code Review Monitoring Report �[0;34m[INFO]�[0m Latest Quality Status: �[0;34m[INFO]�[0m Recent monitoring activity: 📈 Current Quality Metrics
Generated on: Tue Mar 24 09:07:46 UTC 2026 Generated by AI DevOps Framework Code Review Monitoring |
|
|
Closing: merge conflicts with main after reopening. The changes need to be rebased or re-implemented in a fresh branch. |



Summary
select(.user.login == "${username}")filter from the safety-net comment check incmd_check_approvals(line 838)Root cause
The
jqfilter combined two conditions: match the agent's own username AND exclude bots. The intent (per the surrounding comment "Only auto-decline if no user comment exists") is to check for any non-bot human comment. The username equality filter was logically wrong for this purpose.Change
Verification
Closes #5559