branch: elpa/aidermacs commit d9a20f51382a67a0f9a16302ae7c3d74cd54fd05 Author: Mingde (Matthew) Zeng <matthew...@posteo.net> Commit: Mingde (Matthew) Zeng <matthew...@posteo.net>
Add aidermacs-auto-accept-architect Signed-off-by: Mingde (Matthew) Zeng <matthew...@posteo.net> --- README.md | 14 +++++++++++++- aidermacs.el | 9 ++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b76423a9c6..b54d530633 100644 --- a/README.md +++ b/README.md @@ -151,7 +151,19 @@ When Architect mode is enabled, the `aidermacs-default-model` setting is ignored (setq aidermacs-editor-model "deepseek/deepseek-chat") ;; defaults to aidermacs-default-model ``` -*Note: This configuration will be overwritten by the existence of an `.aider.conf.yml` file (see [details](#Overwrite-Configuration-with-Configuration-File)).* +*Note: These configurations will be overwritten by the existence of an `.aider.conf.yml` file (see [details](#Overwrite-Configuration-with-Configuration-File)).* + +#### Architect Mode Confirmation + +By default, Aidermacs requires explicit confirmation before applying changes proposed in Architect mode. This gives you a chance to review the AI's plan before any code is modified. + +If you prefer to automatically accept all Architect mode changes without confirmation (similar to Aider's default behavior), you can enable this with: + +```emacs-lisp +(setq aidermacs-auto-accept-architect t) +``` + +*Note: These configurations will be overwritten by the existence of an `.aider.conf.yml` file (see [details](#Overwrite-Configuration-with-Configuration-File)).* ### Terminal Backend Selection diff --git a/aidermacs.el b/aidermacs.el index 988f058da1..6abe8ac1e0 100644 --- a/aidermacs.el +++ b/aidermacs.el @@ -83,6 +83,11 @@ This is useful for working in monorepos where you want to limit aider's scope." When nil, disable auto-commits requiring manual git commits." :type 'boolean) +(defcustom aidermacs-auto-accept-architect nil + "When non-nil, automatically accept architect mode changes. +When nil, require explicit confirmation before applying changes." + :type 'boolean) + (defun aidermacs-project-root () "Get the project root using project.el, VC, or fallback to file directory. This function tries multiple methods to determine the project root." @@ -260,8 +265,10 @@ This function sets up the appropriate arguments and launches the process." "--editor-model" aidermacs-editor-model) (unless has-model-arg (list "--model" aidermacs-default-model))) - (when (not aidermacs-auto-commits) + (unless aidermacs-auto-commits '("--no-auto-commits")) + (unless aidermacs-auto-accept-architect + '("--no-auto-accept-architect")) (when aidermacs-subtree-only '("--subtree-only"))))) (final-args (append backend-args flat-extra-args)))