diff --git a/aider/args.py b/aider/args.py index 077706d5600..b16d14c4bc5 100644 --- a/aider/args.py +++ b/aider/args.py @@ -797,7 +797,7 @@ def get_parser(default_config_files, git_root): help=( "Run input and output sequentially instead of us simultaneous streams (default: False)" ), - default=False, + default=True, ) group.add_argument( "--debug", @@ -838,9 +838,16 @@ def get_parser(default_config_files, git_root): group.add_argument( "--yes-always", action="store_true", - help="Always say yes to every confirmation", + help="Always say yes to every confirmation (not including cli commands)", default=None, ) + group.add_argument( + "--yes-always-commands", + "--yolo", + action="store_true", + help="Always say yes to every confirmation (including cli commands)", + default=False, + ) group.add_argument( "--disable-playwright", action="store_true", diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 4f2bcde12fd..b97d0300f8b 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -2894,6 +2894,9 @@ async def check_for_file_mentions(self, content): added_fnames = [] group = ConfirmGroup(new_mentions) for rel_fname in sorted(new_mentions): + if self.args.tui: + self.io.tool_output(rel_fname) + if await self.io.confirm_ask( "Add file to the chat?", subject=rel_fname, group=group, allow_never=True ): @@ -3833,7 +3836,7 @@ async def handle_shell_commands(self, commands_str, group): if not await self.io.confirm_ask( prompt, subject="\n".join(commands), - explicit_yes_required=True, + explicit_yes_required=self.args.yes_always_commands, group=group, allow_never=True, ): diff --git a/aider/main.py b/aider/main.py index 1d0a1161326..723cdc8c668 100644 --- a/aider/main.py +++ b/aider/main.py @@ -721,6 +721,9 @@ async def main_async(argv=None, input=None, output=None, force_git_root=None, re if return_coder and args.yes_always is None: args.yes_always = True + if args.yes_always_commands: + args.yes_always = True + editing_mode = EditingMode.VI if args.vim else EditingMode.EMACS def get_io(pretty): diff --git a/aider/repo.py b/aider/repo.py index 7baebfddef0..f2016075b22 100644 --- a/aider/repo.py +++ b/aider/repo.py @@ -21,7 +21,6 @@ from aider import prompts, utils from .dump import dump # noqa: F401 -from .waiting import Spinner ANY_GIT_ERROR += [ OSError, @@ -341,26 +340,27 @@ async def get_commit_message(self, diffs, context, user_language=None): commit_message = None for model in self.models: spinner_text = f"Generating commit message with {model.name}\n" - with Spinner(spinner_text): - if model.system_prompt_prefix: - current_system_content = model.system_prompt_prefix + "\n" + system_content - else: - current_system_content = system_content + self.io.start_spinner(spinner_text, update_last_text=False) - messages = [ - dict(role="system", content=current_system_content), - dict(role="user", content=content), - ] + if model.system_prompt_prefix: + current_system_content = model.system_prompt_prefix + "\n" + system_content + else: + current_system_content = system_content + + messages = [ + dict(role="system", content=current_system_content), + dict(role="user", content=content), + ] - num_tokens = model.token_count(messages) - max_tokens = model.info.get("max_input_tokens") or 0 + num_tokens = model.token_count(messages) + max_tokens = model.info.get("max_input_tokens") or 0 - if max_tokens and num_tokens > max_tokens: - continue + if max_tokens and num_tokens > max_tokens: + continue - commit_message = await model.simple_send_with_retries(messages) - if commit_message: - break # Found a model that could generate the message + commit_message = await model.simple_send_with_retries(messages) + if commit_message: + break # Found a model that could generate the message if not commit_message: self.io.tool_error("Failed to generate commit message!") @@ -370,6 +370,7 @@ async def get_commit_message(self, diffs, context, user_language=None): if commit_message and commit_message[0] == '"' and commit_message[-1] == '"': commit_message = commit_message[1:-1].strip() + self.io.start_spinner(self.io.last_spinner_text, update_last_text=False) return commit_message def get_diffs(self, fnames=None):