Skip to content

Commit c009aea

Browse files
committed
#122: Fix prompts that need to run pre-Coder class initialization
1 parent acc5136 commit c009aea

3 files changed

Lines changed: 31 additions & 28 deletions

File tree

aider/io.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,8 @@ async def recreate_input(self, future=None):
699699
if coder:
700700
self.input_task = asyncio.create_task(coder.get_input())
701701
await asyncio.sleep(0)
702+
else:
703+
self.input_task = asyncio.create_task(self.get_input(None, [], [], []))
702704

703705
async def get_input(
704706
self,

aider/main.py

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async def setup_git(git_root, io):
124124
)
125125
return
126126
elif cwd and await io.confirm_ask(
127-
"No git repo found, create one to track aider's changes (recommended)?"
127+
"No git repo found, create one to track aider's changes (recommended)?", acknowledge=True
128128
):
129129
git_root = str(cwd.resolve())
130130
repo = await make_new_repo(git_root, io)
@@ -193,7 +193,8 @@ async def check_gitignore(git_root, io, ask=True):
193193
if ask:
194194
io.tool_output("You can skip this check with --no-gitignore")
195195
if not await io.confirm_ask(
196-
f"Add {', '.join(patterns_to_add)} to .gitignore (recommended)?"
196+
f"Add {', '.join(patterns_to_add)} to .gitignore (recommended)?",
197+
acknowledge=True,
197198
):
198199
return
199200

@@ -717,28 +718,27 @@ def get_io(pretty):
717718
posthog_host=args.analytics_posthog_host,
718719
posthog_project_api_key=args.analytics_posthog_project_api_key,
719720
)
720-
if args.analytics is not False:
721-
if analytics.need_to_ask(args.analytics):
722-
io.tool_output(
723-
"Aider respects your privacy and never collects your code, chat messages, keys or"
724-
" personal info."
725-
)
726-
io.tool_output(f"For more info: {urls.analytics}")
727-
disable = not await io.confirm_ask(
728-
"Allow collection of anonymous analytics to help improve aider?"
729-
)
730-
731-
analytics.asked_opt_in = True
732-
if disable:
733-
analytics.disable(permanently=True)
734-
io.tool_output("Analytics have been permanently disabled.")
735-
736-
analytics.save_data()
737-
io.tool_output()
738-
739-
# This is a no-op if the user has opted out
740-
analytics.enable()
741721

722+
# if args.analytics is not False:
723+
# if analytics.need_to_ask(args.analytics):
724+
# io.tool_output(
725+
# "Aider respects your privacy and never collects your code, chat messages, keys or"
726+
# " personal info."
727+
# )
728+
# io.tool_output(f"For more info: {urls.analytics}")
729+
# disable = not await io.confirm_ask(
730+
# "Allow collection of anonymous analytics to help improve aider?"
731+
# )
732+
# analytics.asked_opt_in = True
733+
# if disable:
734+
# analytics.disable(permanently=True)
735+
# io.tool_output("Analytics have been permanently disabled.")
736+
# analytics.save_data()
737+
# io.tool_output()
738+
# # This is a no-op if the user has opted out
739+
# analytics.enable()
740+
741+
analytics.disable(permanently=True)
742742
analytics.event("launched")
743743

744744
if args.gui and not return_coder:
@@ -821,11 +821,6 @@ def get_io(pretty):
821821
if args.check_update:
822822
check_version(io, verbose=args.verbose)
823823

824-
if args.git:
825-
git_root = await setup_git(git_root, io)
826-
if args.gitignore:
827-
await check_gitignore(git_root, io)
828-
829824
if args.verbose:
830825
show = format_settings(parser, args)
831826
io.tool_output(show)
@@ -1118,6 +1113,11 @@ def get_io(pretty):
11181113
analytics.event("exit", reason="Keyboard interrupt during model warnings")
11191114
return 1
11201115

1116+
if args.git:
1117+
git_root = await setup_git(git_root, io)
1118+
if args.gitignore:
1119+
await check_gitignore(git_root, io)
1120+
11211121
except UnknownEditFormat as err:
11221122
io.tool_error(str(err))
11231123
await io.offer_url(urls.edit_formats, "Open documentation about edit formats?")

aider/onboarding.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ async def offer_openrouter_oauth(io, analytics):
9393
if await io.confirm_ask(
9494
"Login to OpenRouter or create a free account?",
9595
default="y",
96+
acknowledge=True,
9697
):
9798
analytics.event("oauth_flow_initiated", provider="openrouter")
9899
openrouter_key = start_openrouter_oauth_flow(io, analytics)

0 commit comments

Comments
 (0)