Conversation
Summary of ChangesHello @ryanaiagent, 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 introduces a new automated issue monitoring agent, built using the Google Agent Development Kit (ADK), designed to combat SEO spam, promotional links, and irrelevant content in GitHub issue comments. The agent significantly reduces the manual moderation burden on maintainers by intelligently pre-processing comments, optimizing LLM usage, and ensuring efficient, idempotent operation across the repository's issues. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Activity
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. 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
|
|
Response from ADK Triaging Agent Hello @ryanaiagent, thank you for creating this PR! This PR is a new feature, could you please associate a GitHub issue with this PR? If there is no existing issue, could you please create one? This information will help reviewers to review your PR more efficiently. Thanks! |
|
Response from ADK Triaging Agent Hello @ryanaiagent, thank you for your contribution! To help us track this new feature, could you please create a GitHub issue and link it to this pull request? Thank you! |
|
Response from ADK Triaging Agent Hello @ryanaiagent, thank you for your contribution and for providing a detailed testing plan! To help the reviewers better understand the functionality and the results of your end-to-end tests, could you please provide some logs or screenshots of the agent in action? This will help to verify the functionality and expedite the review process. Thanks! |
There was a problem hiding this comment.
Code Review
The pull request introduces a new issue monitoring agent built with the Google Agent Development Kit (ADK). The agent effectively identifies and flags spam in GitHub issues, incorporating several optimizations like LLM pre-filtering, token truncation, and idempotency. The overall design is robust and addresses the problem statement well. I've identified a few areas for improvement related to code maintainability and a minor bug that could lead to redundant processing.
|
Hi @xuanyang15 , can you please review this. |
| REPO: ${{ github.event.repository.name }} | ||
| CONCURRENCY_LIMIT: 3 | ||
| INITIAL_FULL_SCAN: ${{ github.event.inputs.full_scan == 'true' }} | ||
| run: python -m spam_sweeper_agent.main No newline at end of file |
There was a problem hiding this comment.
Shouldn't this be python -m adk_issue_monitoring_agent.main?
| pip install requests google-adk python-dotenv | ||
|
|
||
| - name: Run Issue Monitoring Agent | ||
| env: |
There was a problem hiding this comment.
Do we miss PYTHONPATH, otherwise, it may fail with adk_issue_monitoring_agent module not being found.
| import logging | ||
| import re | ||
| import time | ||
| from typing import List |
There was a problem hiding this comment.
We prefer to use built-in list and |
| logger = logging.getLogger("google_adk." + __name__) | ||
|
|
||
| _api_call_count = 0 | ||
| _counter_lock = threading.Lock() |
There was a problem hiding this comment.
It looks we are using asyncio.gather which is concurrent but not multi threadking, so threading.Lock might not work.
| total=6, | ||
| backoff_factor=2, | ||
| status_forcelist=[429, 500, 502, 503, 504], | ||
| allowed_methods=["GET", "POST", "PATCH", "DELETE"], |
There was a problem hiding this comment.
POST is not idempotent, so we probably need to be careful for retrying POST calls to avoid duplications.
Maybe we should add some checking logic before POST calls, e.g
In flag_issue_as_spam, we can check
- if an issue is already labeled and commented, we skip
- if an issue is labeled but not commented, we comment
- if an issue is not labeled nor commented, we label and comment
Similarly, for other POST calls if needed.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
2. Or, if no issue exists, describe the change:
Problem:
Open-source repositories frequently suffer from SEO spam, unsolicited promotional links, and irrelevant 3rd-party endorsements in issue comments. Manually monitoring, reading, and moderating these comments is a time-consuming burden for maintainers.
Solution:
Implemented the
adk_issue_monitoring_agent, an automated moderation bot built using the Google Agent Development Kit (ADK) that monitors recently updated issues for spam.Key features and cost-optimizations include:
[bot]accounts, and the officialadk-bot, ensuring Gemini LLM tokens are never wasted on safe comments.[CODE BLOCK REMOVED]) and truncates unusually long text/logs to 1500 characters, preventing spammers from hiding links in massive stack traces while keeping API costs near zero.🚨 **Automated Spam Detection Alert** 🚨). If it has already flagged an issue, it instantly skips it to prevent infinite feedback loops.issue-monitor.ymlworkflow that runs a lightweight "Daily Sweep" (only checking issues updated in the last 24 hours) via cron, and supports a manualworkflow_dispatchcheckbox to perform a Day 1 "Deep Clean" of the entire repository.Testing Plan
Unit Tests:
Note: The agent relies on the core ADK
AgentandInMemoryRunnercomponents which are covered by the existing test suite. No core framework tests were broken.Manual End-to-End (E2E) Tests:
I rigorously tested the agent locally on a fork of the repository with Issues enabled.
Setup:
.envfile withINITIAL_FULL_SCAN=trueandOWNERset to my fork.Results:
spamlabel, and posted the warning alert tagging maintainers.isortandpyinkto ensure all code adheres strictly to the Google Python Style Guide.Checklist
Additional context
This agent is located in
contributing/samples/adk_issue_monitoring_agent/and includes a comprehensiveREADME.mddetailing how repository maintainers can configure, deploy, and customize the bot using GitHub Actions.