From cde08da2827518eaa84f2fb87a57a07968d5ed62 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Fri, 28 Mar 2025 16:42:12 -1000 Subject: [PATCH] refactor: Simplify model selection warning and analytics event logging --- aider/main.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/aider/main.py b/aider/main.py index a27f9e8e7..080345191 100644 --- a/aider/main.py +++ b/aider/main.py @@ -768,16 +768,14 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F for env_key, model_name in model_key_pairs: if os.environ.get(env_key): args.model = model_name - io.tool_warning( - f"Found {env_key} so using {model_name} since no --model was specified." - ) + io.tool_warning(f"Using {model_name} model with {env_key} environment variable.") # Track which API key was used for auto-selection - analytics.event("auto_model_selection", api_key=env_key, main_model=model_name) + analytics.event("auto_model_selection", api_key=env_key) break if not args.model: io.tool_error("You need to specify a --model and an --api-key to use.") io.offer_url(urls.models_and_keys, "Open documentation url for more info?") - analytics.event("auto_model_selection", api_key=None, main_model=None) + analytics.event("auto_model_selection", api_key=None) return 1 main_model = models.Model(