fix(core): discourage unprompted git add . in prompt snippets#26220
fix(core): discourage unprompted git add . in prompt snippets#26220
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 improves the reliability of Git operations performed by the agent by refining the instructions provided in the core prompt snippets. By discouraging indiscriminate staging commands, the agent is now guided to be more precise and intentional when preparing commits, which helps prevent common errors related to staging unintended files. 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
|
🛑 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. |
ca16fc1 to
8c3aab8
Compare
|
Size Change: +430 B (0%) Total Size: 33.9 MB
ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request updates the git-related prompt instructions in the core package to prevent the AI agent from using bulk staging commands like git add . or git add -A unprompted. The instructions now explicitly require staging only the specific files that were changed or created as part of the task. I have no feedback to provide.
Note: Security Review did not run due to the size of the PR.
Samee24
left a comment
There was a problem hiding this comment.
Can we add behavioral eval(s) for this?
Update instructions to prompt the agent to stage only task-specific changed files to prevent unprompted staging of untracked files. Fixes #24628
ac21aab to
e0bfc35
Compare
|
Good callout. I have added the behavioral test. |
|
@gemini-code-assist can you review the behavioral test that I have added. Does it cover all the changes in this PR? |
|
Thank you for adding the behavioral test. I have reviewed the test case in |
|
@gemini-code-assist can you give me a detailed summary of the test that was added for @Samee24 |
Summary of ChangesThis pull request refines the agent's Git workflow instructions to improve precision when staging files for commits. By discouraging the use of broad staging commands, the agent is encouraged to be more intentional, reducing the risk of accidentally including unintended or untracked files in commits. A new behavioral test ensures these instructions are followed correctly. Highlights
Activity
|
|
@Samee24 the test has been added. Pls review. Thanks. |
This PR explicitly discourages the use of
git add .orgit add -Aunprompted by updating the instructions in bothsnippets.tsandsnippets.legacy.ts. Instead, the agent is instructed to selectively stage task-specific changed files.Fixes #24628