feat: apply_patch auto approve (#7777)

* Added apply_patch to auto approve, strict mode, and minor prompting adjustment

* changeset
This commit is contained in:
canvrno authored and GitHub committed 2025-12-02 15:36:01 -08:00
1 parent 639edb5db6
commit dd52a4a39c
4 files changed
+11 -1

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
---
"claude-dev": patch
---
Added apply_patch to auto approve, strict mode, and minor prompting adjustment
@@ -30,7 +30,9 @@ EOF
Where [YOUR_PATCH] is the actual content of your patch, specified in the following V4A diff format.
*** [ACTION] File: [path/to/file] -> ACTION can be one of Add, Update, or Delete.
For each snippet of code that needs to be changed, repeat the following:
In a Add File section, every line of the new file (including blank/empty lines) MUST start with a \`+\` prefix. Do not include any unprefixed lines inside an Add section
In a Update/Delete section, repeat the following for each snippet of code that needs to be changed:
[context_before] -> See below for further instructions on context.
- [old_code] -> Precede the old code with a minus sign.
+ [new_code] -> Precede the new, replacement code with a plus sign.
+1
View File
@@ -302,6 +302,7 @@ export class ToolExecutor {
ClineDefaultTool.FILE_NEW,
ClineDefaultTool.FILE_EDIT,
ClineDefaultTool.NEW_RULE,
ClineDefaultTool.APPLY_PATCH,
]
/**
+2
View File
@@ -49,6 +49,7 @@ export class AutoApprove {
case ClineDefaultTool.NEW_RULE:
case ClineDefaultTool.FILE_NEW:
case ClineDefaultTool.FILE_EDIT:
case ClineDefaultTool.APPLY_PATCH:
case ClineDefaultTool.BASH:
return [true, true]
@@ -71,6 +72,7 @@ export class AutoApprove {
case ClineDefaultTool.NEW_RULE:
case ClineDefaultTool.FILE_NEW:
case ClineDefaultTool.FILE_EDIT:
case ClineDefaultTool.APPLY_PATCH:
return [autoApprovalSettings.actions.editFiles, autoApprovalSettings.actions.editFilesExternally ?? false]
case ClineDefaultTool.BASH:
return [