From ed8ace7884d61f67e983be6f95dac315ea592bf5 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 18 Mar 2025 12:24:06 -0700 Subject: [PATCH] feat: Add confirmation prompt for unsupported model parameters --- aider/main.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/aider/main.py b/aider/main.py index ce7db0833..99e9c60ed 100644 --- a/aider/main.py +++ b/aider/main.py @@ -796,6 +796,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F # Show warnings about unsupported settings after all model settings are fully resolved if args.check_model_accepts_settings: + warned = False if args.reasoning_effort is not None and ( not main_model.accepts_settings or "reasoning_effort" not in main_model.accepts_settings ): @@ -803,6 +804,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F f"Warning: The model {main_model.name} may not support the 'reasoning_effort'" " setting." ) + warned = True if args.thinking_tokens is not None and ( not main_model.accepts_settings or "thinking_tokens" not in main_model.accepts_settings @@ -811,6 +813,12 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F f"Warning: The model {main_model.name} may not support the 'thinking_tokens'" " setting." ) + warned = True + + if warned: + if not io.confirm_ask("Sending unsupported parameters can cause API calls to fail. Continue anyway?"): + analytics.event("exit", reason="User canceled after parameter warning") + return 1 if args.copy_paste and args.edit_format is None: if main_model.edit_format in ("diff", "whole"):