Skip to content

Conversation

@ryanaiagent
Copy link
Collaborator

@ryanaiagent ryanaiagent commented Dec 17, 2025

Problem

The stale bot was incorrectly marking issues as stale when the last comment was a question from one maintainer to another (e.g., @maintainerB what do you think?). The bot interpreted this as a question waiting for the author, rather than an active internal discussion.

Solution

  1. Updated agent.py: Modified get_issue_state to expose the full list of maintainers and the last_actor_name to the LLM context.
  2. Updated Prompt: Added a check in Step 3 of the decision tree. If a maintainer mentions another maintainer in their comment, the issue is now considered ACTIVE (Internal Team Discussion) regardless of whether it is phrased as a question.

Changes

  • adk_stale_agent/agent.py: Pass maintainers list and last_actor_name to the LLM.
  • adk_stale_agent/PROMPT_INSTRUCTION.txt: Added instruction to check for maintainer-to-maintainer mentions.

Checklist

  • I have read the CONTRIBUTING.md document.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have manually tested my changes end-to-end.
  • Any dependent changes have been merged and published in downstream modules.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 crucial improvement to the stale bot's behavior, ensuring that active internal discussions among maintainers do not lead to issues being prematurely marked as stale. By providing the bot with more context about who is commenting and who is being addressed, it can now intelligently differentiate between a question awaiting an author's response and an ongoing team collaboration, thereby enhancing workflow efficiency and reducing false positives.

Highlights

  • Stale Bot Logic Refinement: The stale bot's logic has been updated to prevent it from incorrectly flagging issues as stale when maintainers are engaged in internal discussions.
  • Enhanced LLM Context: The agent.py file now passes the full list of maintainers and the last_actor_name to the LLM context, providing more information for decision-making.
  • Prompt Instruction Update: The PROMPT_INSTRUCTION.txt has been modified to include a new check: if a maintainer mentions another maintainer in a comment, the issue is now explicitly considered ACTIVE (Internal Team Discussion).
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/stale-bot.yml
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.

@adk-bot adk-bot added the tools [Component] This issue is related to tools label Dec 17, 2025
@adk-bot
Copy link
Collaborator

adk-bot commented Dec 17, 2025

Response from ADK Triaging Agent

Hello @ryanaiagent, thank you for creating this PR!

I noticed that the checklist in your PR description indicates that tests have not been added. To ensure the quality of the codebase, our contribution guidelines require that all code changes include tests.

Could you please add tests that prove your fix is effective? You can find more details in the Testing Requirements section of our contribution guide.

This will help reviewers to verify your changes more efficiently. Thanks!

Copy link
Contributor

@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 the issue of the stale bot incorrectly flagging issues with active internal maintainer discussions. The changes in agent.py correctly provide the necessary context (maintainers list, last actor) to the LLM. The updated prompt in PROMPT_INSTRUCTION.txt introduces a new, well-placed check for maintainer-to-maintainer communication, which should prevent the erroneous flagging. The overall solution is well-designed. I have one suggestion to improve the clarity of a tool-calling instruction in the prompt to make it more robust.

@ryanaiagent
Copy link
Collaborator Author

Hi @xuanyang15 , can you review this and get this merged.

copybara-service bot pushed a commit that referenced this pull request Dec 19, 2025
Merge #3938

Co-authored-by: Xuan Yang <xygoogle@google.com>
COPYBARA_INTEGRATE_REVIEW=#3938 from ryanaiagent:fix/stale-bot-logic 605d349
PiperOrigin-RevId: 846450195
@adk-bot
Copy link
Collaborator

adk-bot commented Dec 19, 2025

Thank you @ryanaiagent for your contribution! 🎉

Your changes have been successfully imported and merged via Copybara in commit f51b9b7.

Closing this PR as the changes are now in the main branch.

@adk-bot adk-bot closed this Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants