Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions aider/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
5 changes: 4 additions & 1 deletion aider/coders/base_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
):
Expand Down Expand Up @@ -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,
):
Expand Down
3 changes: 3 additions & 0 deletions aider/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
35 changes: 18 additions & 17 deletions aider/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from aider import prompts, utils

from .dump import dump # noqa: F401
from .waiting import Spinner

ANY_GIT_ERROR += [
OSError,
Expand Down Expand Up @@ -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!")
Expand All @@ -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):
Expand Down
Loading