Fix #28227: add support for AGENTS.md out of the box#28240
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
📊 PR Size: size/M
|
🛑 Action Required: Evaluation ApprovalSteering changes have been detected in this PR. To prevent regressions, a maintainer must approve the evaluation run before this PR can be merged. Maintainers:
Once approved, the evaluation results will be posted here automatically. |
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 enhances the system's context awareness by adding 'AGENTS.md' as a default configuration file alongside 'GEMINI.md'. By updating the core memory tool and associated initialization logic, the system now automatically prioritizes these files without requiring manual user configuration in settings.json, while maintaining backward compatibility and improving test coverage. 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 the 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 counterproductive. 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
|
There was a problem hiding this comment.
Code Review
This pull request adds AGENTS.md as a default context file alongside GEMINI.md by introducing DEFAULT_CONTEXT_FILENAMES and updating the default configuration, system prompts, and associated tests. The reviewer noted an inconsistency in resetGeminiMdFilename where the fallback logic for an empty array still references the single DEFAULT_CONTEXT_FILENAME instead of the new DEFAULT_CONTEXT_FILENAMES array.
| export function resetGeminiMdFilename( | ||
| filename: string | string[] = DEFAULT_CONTEXT_FILENAME, | ||
| filename: string | string[] = DEFAULT_CONTEXT_FILENAMES, | ||
| ): void { |
There was a problem hiding this comment.
In resetGeminiMdFilename, when the filtered cleaned array is empty (for example, if an empty array [] or only invalid/non-existent paths are passed), the function falls back to DEFAULT_CONTEXT_FILENAME (which is 'GEMINI.md') on line 69:
if (cleaned.length === 0) {
currentGeminiMdFilename = DEFAULT_CONTEXT_FILENAME;
}Since the new default context filenames are DEFAULT_CONTEXT_FILENAMES (['GEMINI.md', 'AGENTS.md']), this fallback should be updated to DEFAULT_CONTEXT_FILENAMES to ensure consistency and that AGENTS.md is not ignored in fallback scenarios.
|
@google-gemini/gemini-cli-maintainers @google-gemini/gemini-cli-prompt-approvers Hi team! This PR fixes the issue where All CI checks are currently passing. Whenever you have a moment, I'd appreciate a review so we can get this merged in! Thank you! |
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
Fixes #28227
Description
This PR fixes an issue where the
AGENTS.mdcontext file was ignored by default unless explicitly listed in the user's~/.gemini/settings.json.Changes made:
memoryToolto use the array['GEMINI.md', 'AGENTS.md']as the default context filenames, ensuringGEMINI.mdretains its priority.resetGeminiMdFilename()usage in the CLI initialization to cleanly fallback to this new core default.