Fix posting invalid response to a comment#26266
Conversation
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 updates the operational documentation for the repository agent to enforce the correct usage of file-writing tools. By clarifying these protocols, the changes ensure that the agent consistently generates the necessary files for posting comments and handling tasks, thereby resolving issues where the bot might otherwise fail to communicate or post incorrect information. Highlights
Ignored Files
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
|
|
Size Change: -4 B (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request updates the bot's operational instructions in common.md and interactive.md to explicitly mandate the use of the write_file tool for creating metadata and communication files like pr-description.md and issue-comment.md. The review feedback recommends further clarifying these instructions by using 'MUST' directives and explicitly forbidding console output to ensure the workflow correctly captures the bot's responses. Additionally, a suggestion was made to instruct the bot to terminate its process after informing a user that a request is obsolete or requires no action, preventing unintended subsequent operations.
Note: Security Review has been skipped due to the limited scope of the PR.
| addressed or obsolete, inform them by using the `write_file` tool to save a | ||
| message to `issue-comment.md`. |
There was a problem hiding this comment.
The prompt instructs the agent to inform the user if a request is obsolete, but it lacks a directive to terminate the process. Without this, the agent may continue to the analysis and implementation phases, potentially overwriting the 'obsolete' message or performing unintended actions. Additionally, incorporating a generic message here fulfills the goal mentioned in the PR description regarding cases where the agent chooses not to reply.
| addressed or obsolete, inform them by using the `write_file` tool to save a | |
| message to `issue-comment.md`. | |
| addressed or obsolete, or if you determine that no action is needed, inform | |
| them by using the write_file tool to save a message to issue-comment.md | |
| (e.g., "I've investigated your request but determined that no changes are | |
| necessary at this time.") and do not proceed with further analysis or | |
| changes. |
| - **Acknowledgment**: Use the `write_file` tool to write a brief acknowledgement | ||
| to `issue-comment.md` (e.g., "I've investigated the request and implemented a | ||
| fix. A PR will be created shortly."). |
There was a problem hiding this comment.
To ensure the bot correctly posts the acknowledgement and avoids the "wrong comment" issue mentioned in the PR, this instruction should be as explicit as the one in the Q&A section. Adding a "MUST" and a warning against console output will help enforce the correct tool usage.
| - **Acknowledgment**: Use the `write_file` tool to write a brief acknowledgement | |
| to `issue-comment.md` (e.g., "I've investigated the request and implemented a | |
| fix. A PR will be created shortly."). | |
| - Acknowledgment: You MUST use the write_file tool to write a brief | |
| acknowledgement to issue-comment.md (e.g., "I've investigated the request | |
| and implemented a fix. A PR will be created shortly."). DO NOT simply output | |
| your response to the console. |
| 3. **Acknowledgment**: If invoked by a comment, use the `write_file` tool to | ||
| save a brief acknowledgement to `issue-comment.md`. |
There was a problem hiding this comment.
Similar to the interactive brain, the common rules should explicitly forbid console output for acknowledgements to ensure they are correctly captured by the workflow. This maintains consistency across different brain configurations.
| 3. **Acknowledgment**: If invoked by a comment, use the `write_file` tool to | |
| save a brief acknowledgement to `issue-comment.md`. | |
| 3. Acknowledgment: If invoked by a comment, you MUST use the write_file | |
| tool to save a brief acknowledgement to issue-comment.md. DO NOT simply | |
| output your response to the console. |
References
- Maintain consistency in documentation. When information about a feature is present in multiple documents, ensure all instances are updated or removed together to avoid contradictions.
|
@gemini-cli running test for PR #26266 workflow changes |
|
Hello @gundermanc! I've investigated the changes in PR #26266 and confirmed that they correctly address the issue where the bot could post a stale comment from a previous session. Findings:
Regarding your mention of The changes look solid and ready for merge! 🚀 |
Summary
Fixes an issue where the repo agent posts the wrong comment in response to being @ mentioned. Also provides a generic error message if the agent chooses not to reply.