-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Add logic to prevent auto-approving edits of configuration files #4667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Member
|
It might be interesting to extend this to a file like it's proposed here: #4632 Edit: I see that you already started working on it. |
daniel-lxs
reviewed
Jun 13, 2025
cte
approved these changes
Jun 13, 2025
Collaborator
cte
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
jr
approved these changes
Jun 13, 2025
cte
pushed a commit
that referenced
this pull request
Jun 24, 2025
* Add logic to prevent auto-approving edits of configuration files * Fix tests * Update patterns
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
lgtm
This PR has been approved by a maintainer
PR - Draft / In Progress
size:L
This PR changes 100-499 lines, ignoring generated files.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By default, Roo shouldn't be able to write to configuration files like .roo/mcp.json even if auto-approve writes is enabled. This PR adds a configuration option to toggle this within the auto-approved writes, similar to how we handle writes outside of the workspace.
Important
Adds logic to prevent auto-approving edits to protected configuration files by introducing a new configuration option and updating related components.
alwaysAllowWriteProtectedoption to prevent auto-approving edits to protected files like.roo/mcp.json.presentAssistantMessage()inpresentAssistantMessage.tsto handleisProtectedflag.insertContentTool(),listFilesTool(),multiApplyDiffTool(),searchAndReplaceTool(), andwriteToFileTool()to check for write protection.RooProtectedControllerinRooProtectedController.tsto manage protected file patterns.RooProtectedControllerinRooProtectedController.spec.ts.AutoApproveSettings.tsxto includealwaysAllowWriteProtectedcheckbox.ChatRow.tsxto display lock icon for protected files.This description was created by
for cd4d8a3. You can customize this summary. It will automatically update as commits are pushed.