From e8c153f72f54cc5ac91bdbb8f45208c58be64dec Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 07:02:22 -0800 Subject: [PATCH 01/53] docs: add refactoring comments for issue handling functions --- scripts/issues.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/issues.py b/scripts/issues.py index a02fd235e..8677ce367 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -149,6 +149,7 @@ def main(): all_issues = get_issues("all") if args.find_unlabeled: + #ai refactor this into a function... print("\nFinding unlabeled issues with paul-gauthier comments...") unlabeled_issues = find_unlabeled_with_paul_comments(all_issues) @@ -173,6 +174,9 @@ def main(): response.raise_for_status() print(f" - Added 'question' label to #{issue['number']}") return + # ... to here + + # ai also refactor this into its own function... open_issues = [issue for issue in all_issues if issue["state"] == "open"] grouped_open_issues = group_issues_by_subject(open_issues) @@ -212,6 +216,7 @@ def main(): if oldest_issue["state"] == "open": print(f"Oldest issue #{oldest_issue['number']} left open") + # ai ... to here! if __name__ == "__main__": From 17351e8f91e69abbdc63f76435a67758f7cd1309 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 5 Nov 2024 07:02:24 -0800 Subject: [PATCH 02/53] refactor: extract issue handling into dedicated functions --- scripts/issues.py | 88 ++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 43 deletions(-) diff --git a/scripts/issues.py b/scripts/issues.py index 8677ce367..90f95ddc8 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -130,53 +130,33 @@ def find_unlabeled_with_paul_comments(issues): return unlabeled_issues -def main(): - parser = argparse.ArgumentParser(description="Handle duplicate GitHub issues") - parser.add_argument( - "--yes", action="store_true", help="Automatically close duplicates without prompting" - ) - parser.add_argument( - "--find-unlabeled", - action="store_true", - help="Find unlabeled issues with paul-gauthier comments", - ) - args = parser.parse_args() +def handle_unlabeled_issues(all_issues, auto_yes): + print("\nFinding unlabeled issues with paul-gauthier comments...") + unlabeled_issues = find_unlabeled_with_paul_comments(all_issues) - if not TOKEN: - print("Error: Missing GITHUB_TOKEN environment variable. Please check your .env file.") + if not unlabeled_issues: + print("No unlabeled issues with paul-gauthier comments found.") return - all_issues = get_issues("all") + print(f"\nFound {len(unlabeled_issues)} unlabeled issues with paul-gauthier comments:") + for issue in unlabeled_issues: + print(f" - #{issue['number']}: {issue['title']} {issue['html_url']}") - if args.find_unlabeled: - #ai refactor this into a function... - print("\nFinding unlabeled issues with paul-gauthier comments...") - unlabeled_issues = find_unlabeled_with_paul_comments(all_issues) - - if not unlabeled_issues: - print("No unlabeled issues with paul-gauthier comments found.") + if not auto_yes: + confirm = input("\nDo you want to add the 'question' label to these issues? (y/n): ") + if confirm.lower() != "y": + print("Skipping labeling.") return - print(f"\nFound {len(unlabeled_issues)} unlabeled issues with paul-gauthier comments:") - for issue in unlabeled_issues: - print(f" - #{issue['number']}: {issue['title']} {issue['html_url']}") + print("\nAdding 'question' label to issues...") + for issue in unlabeled_issues: + url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}" + response = requests.patch(url, headers=headers, json={"labels": ["question"]}) + response.raise_for_status() + print(f" - Added 'question' label to #{issue['number']}") - if not args.yes: - confirm = input("\nDo you want to add the 'question' label to these issues? (y/n): ") - if confirm.lower() != "y": - print("Skipping labeling.") - return - print("\nAdding 'question' label to issues...") - for issue in unlabeled_issues: - url = f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}" - response = requests.patch(url, headers=headers, json={"labels": ["question"]}) - response.raise_for_status() - print(f" - Added 'question' label to #{issue['number']}") - return - # ... to here - - # ai also refactor this into its own function... +def handle_duplicate_issues(all_issues, auto_yes): open_issues = [issue for issue in all_issues if issue["state"] == "open"] grouped_open_issues = group_issues_by_subject(open_issues) @@ -202,21 +182,43 @@ def main(): f" {oldest_issue['html_url']} ({oldest_issue['state']})" ) - if not args.yes: - # Confirmation prompt + if not auto_yes: confirm = input("Do you want to comment and close duplicate issues? (y/n): ") if confirm.lower() != "y": print("Skipping this group of issues.") continue - # Comment and close duplicate issues for issue in issues: if issue["number"] != oldest_issue["number"]: comment_and_close_duplicate(issue, oldest_issue) if oldest_issue["state"] == "open": print(f"Oldest issue #{oldest_issue['number']} left open") - # ai ... to here! + + +def main(): + parser = argparse.ArgumentParser(description="Handle duplicate GitHub issues") + parser.add_argument( + "--yes", action="store_true", help="Automatically close duplicates without prompting" + ) + parser.add_argument( + "--find-unlabeled", + action="store_true", + help="Find unlabeled issues with paul-gauthier comments", + ) + args = parser.parse_args() + + if not TOKEN: + print("Error: Missing GITHUB_TOKEN environment variable. Please check your .env file.") + return + + all_issues = get_issues("all") + + if args.find_unlabeled: + handle_unlabeled_issues(all_issues, args.yes) + return + + handle_duplicate_issues(all_issues, args.yes) if __name__ == "__main__": From 2dd83e7dbeccba240db0354a82c3ec332b7e5a67 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 5 Nov 2024 07:04:11 -0800 Subject: [PATCH 03/53] feat: exclude pull requests from unlabeled issues search --- scripts/issues.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/issues.py b/scripts/issues.py index 90f95ddc8..873a85802 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -115,6 +115,10 @@ def comment_and_close_duplicate(issue, oldest_issue): def find_unlabeled_with_paul_comments(issues): unlabeled_issues = [] for issue in issues: + # Skip pull requests + if "pull_request" in issue: + continue + if not issue["labels"] and issue["state"] == "open": # Get comments for this issue comments_url = ( From 54b9c46b96cabbb2963787e32b42be9a6f3315f1 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 5 Nov 2024 07:04:15 -0800 Subject: [PATCH 04/53] style: Fix whitespace in issues.py script --- scripts/issues.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/issues.py b/scripts/issues.py index 873a85802..063c29fc3 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -118,7 +118,7 @@ def find_unlabeled_with_paul_comments(issues): # Skip pull requests if "pull_request" in issue: continue - + if not issue["labels"] and issue["state"] == "open": # Get comments for this issue comments_url = ( From 6177856baff8166e1d489ef2bb8430517f081161 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 08:45:48 -0800 Subject: [PATCH 05/53] refactor: simplify issues script by removing redundant flag --- scripts/issues.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/scripts/issues.py b/scripts/issues.py index 063c29fc3..f41e53baa 100755 --- a/scripts/issues.py +++ b/scripts/issues.py @@ -205,11 +205,6 @@ def main(): parser.add_argument( "--yes", action="store_true", help="Automatically close duplicates without prompting" ) - parser.add_argument( - "--find-unlabeled", - action="store_true", - help="Find unlabeled issues with paul-gauthier comments", - ) args = parser.parse_args() if not TOKEN: @@ -218,10 +213,7 @@ def main(): all_issues = get_issues("all") - if args.find_unlabeled: - handle_unlabeled_issues(all_issues, args.yes) - return - + handle_unlabeled_issues(all_issues, args.yes) handle_duplicate_issues(all_issues, args.yes) From 12698998b94b6ba869ed958b29b6d503eef01dbf Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 08:48:06 -0800 Subject: [PATCH 06/53] feat: add verbose output for file processing in RepoMap --- aider/repomap.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aider/repomap.py b/aider/repomap.py index 12bd40b75..e4f11a432 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -368,6 +368,8 @@ class RepoMap: showing_bar = False for fname in fnames: + if self.verbose: + self.io.tool_output(f"Processing {fname}") if progress and not showing_bar: progress() From da4b3770c07b772d27f2d2245cae9715ef27eb99 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 08:49:53 -0800 Subject: [PATCH 07/53] refactor: set use_repo_map=True for Claude 3.5 Haiku models --- aider/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/aider/models.py b/aider/models.py index bc0fac898..b49a93c76 100644 --- a/aider/models.py +++ b/aider/models.py @@ -345,6 +345,7 @@ MODEL_SETTINGS = [ }, cache_control=True, ), + #ai all the 3.5 haikus should have use_repo_map=True! ModelSettings( "anthropic/claude-3-5-haiku-20241022", "diff", From 33db8ee0c397deb0ba9a88cb3a818f17316060d8 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 5 Nov 2024 08:49:56 -0800 Subject: [PATCH 08/53] feat: enable repo map for Claude 3.5 Haiku models --- aider/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/models.py b/aider/models.py index b49a93c76..637932b62 100644 --- a/aider/models.py +++ b/aider/models.py @@ -345,11 +345,11 @@ MODEL_SETTINGS = [ }, cache_control=True, ), - #ai all the 3.5 haikus should have use_repo_map=True! ModelSettings( "anthropic/claude-3-5-haiku-20241022", "diff", weak_model_name="anthropic/claude-3-5-haiku-20241022", + use_repo_map=True, extra_params={ "extra_headers": { "anthropic-beta": ANTHROPIC_BETA_HEADER, @@ -361,6 +361,7 @@ MODEL_SETTINGS = [ "claude-3-5-haiku-20241022", "diff", weak_model_name="claude-3-5-haiku-20241022", + use_repo_map=True, examples_as_sys_msg=True, extra_params={ "extra_headers": { From 44cab0a4d723140dee859eee1d6b1b369651dffc Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 09:01:35 -0800 Subject: [PATCH 09/53] refactor: update Claude model references to use 3.5-haiku-20241022 --- aider/models.py | 47 +++++++++++++++-------------------------------- 1 file changed, 15 insertions(+), 32 deletions(-) diff --git a/aider/models.py b/aider/models.py index 637932b62..73b1d04ff 100644 --- a/aider/models.py +++ b/aider/models.py @@ -234,24 +234,24 @@ MODEL_SETTINGS = [ ModelSettings( "claude-3-opus-20240229", "diff", - weak_model_name="claude-3-haiku-20240307", + weak_model_name="claude-3-5-haiku-20241022", use_repo_map=True, ), ModelSettings( "openrouter/anthropic/claude-3-opus", "diff", - weak_model_name="openrouter/anthropic/claude-3-haiku", + weak_model_name="openrouter/anthropic/claude-3-5-haiku", use_repo_map=True, ), ModelSettings( "claude-3-sonnet-20240229", "whole", - weak_model_name="claude-3-haiku-20240307", + weak_model_name="claude-3-5-haiku-20241022", ), ModelSettings( "claude-3-5-sonnet-20240620", "diff", - weak_model_name="claude-3-haiku-20240307", + weak_model_name="claude-3-5-haiku-20241022", editor_model_name="claude-3-5-sonnet-20240620", editor_edit_format="editor-diff", use_repo_map=True, @@ -268,7 +268,7 @@ MODEL_SETTINGS = [ ModelSettings( "anthropic/claude-3-5-sonnet-20240620", "diff", - weak_model_name="anthropic/claude-3-haiku-20240307", + weak_model_name="anthropic/claude-3-5-haiku-20241022", editor_model_name="anthropic/claude-3-5-sonnet-20240620", editor_edit_format="editor-diff", use_repo_map=True, @@ -285,7 +285,7 @@ MODEL_SETTINGS = [ ModelSettings( "anthropic/claude-3-5-sonnet-20241022", "diff", - weak_model_name="anthropic/claude-3-haiku-20240307", + weak_model_name="anthropic/claude-3-5-haiku-20241022", editor_model_name="anthropic/claude-3-5-sonnet-20241022", editor_edit_format="editor-diff", use_repo_map=True, @@ -302,7 +302,7 @@ MODEL_SETTINGS = [ ModelSettings( "anthropic/claude-3-5-sonnet-latest", "diff", - weak_model_name="anthropic/claude-3-haiku-20240307", + weak_model_name="anthropic/claude-3-5-haiku-20241022", editor_model_name="anthropic/claude-3-5-sonnet-20241022", editor_edit_format="editor-diff", use_repo_map=True, @@ -319,7 +319,7 @@ MODEL_SETTINGS = [ ModelSettings( "claude-3-5-sonnet-20241022", "diff", - weak_model_name="claude-3-haiku-20240307", + weak_model_name="claude-3-5-haiku-20241022", editor_model_name="claude-3-5-sonnet-20241022", editor_edit_format="editor-diff", use_repo_map=True, @@ -374,28 +374,11 @@ MODEL_SETTINGS = [ "vertex_ai/claude-3-5-haiku@20241022", "diff", weak_model_name="vertex_ai/claude-3-5-haiku@20241022", + use_repo_map=True, extra_params={ "max_tokens": 4096, }, ), - ModelSettings( - "openrouter/anthropic/claude-3.5-haiku", - "diff", - weak_model_name="openrouter/anthropic/claude-3.5-haiku", - extra_params={ - "max_tokens": 4096, - }, - cache_control=True, - ), - ModelSettings( - "openrouter/anthropic/claude-3.5-haiku:beta", - "diff", - weak_model_name="openrouter/anthropic/claude-3.5-haiku:beta", - extra_params={ - "max_tokens": 4096, - }, - cache_control=True, - ), ModelSettings( "claude-3-haiku-20240307", "whole", @@ -411,7 +394,7 @@ MODEL_SETTINGS = [ ModelSettings( "openrouter/anthropic/claude-3.5-sonnet", "diff", - weak_model_name="openrouter/anthropic/claude-3-haiku", + weak_model_name="openrouter/anthropic/claude-3-5-haiku", editor_model_name="openrouter/anthropic/claude-3.5-sonnet", editor_edit_format="editor-diff", use_repo_map=True, @@ -425,7 +408,7 @@ MODEL_SETTINGS = [ ModelSettings( "openrouter/anthropic/claude-3.5-sonnet:beta", "diff", - weak_model_name="openrouter/anthropic/claude-3-haiku:beta", + weak_model_name="openrouter/anthropic/claude-3-5-haiku:beta", editor_model_name="openrouter/anthropic/claude-3.5-sonnet:beta", editor_edit_format="editor-diff", use_repo_map=True, @@ -441,7 +424,7 @@ MODEL_SETTINGS = [ ModelSettings( "vertex_ai/claude-3-5-sonnet@20240620", "diff", - weak_model_name="vertex_ai/claude-3-haiku@20240307", + weak_model_name="vertex_ai/claude-3-5-haiku@20241022", editor_model_name="vertex_ai/claude-3-5-sonnet@20240620", editor_edit_format="editor-diff", use_repo_map=True, @@ -454,7 +437,7 @@ MODEL_SETTINGS = [ ModelSettings( "vertex_ai/claude-3-5-sonnet-v2@20241022", "diff", - weak_model_name="vertex_ai/claude-3-haiku@20240307", + weak_model_name="vertex_ai/claude-3-5-haiku@20241022", editor_model_name="vertex_ai/claude-3-5-sonnet-v2@20241022", editor_edit_format="editor-diff", use_repo_map=True, @@ -467,13 +450,13 @@ MODEL_SETTINGS = [ ModelSettings( "vertex_ai/claude-3-opus@20240229", "diff", - weak_model_name="vertex_ai/claude-3-haiku@20240307", + weak_model_name="vertex_ai/claude-3-5-haiku@20241022", use_repo_map=True, ), ModelSettings( "vertex_ai/claude-3-sonnet@20240229", "whole", - weak_model_name="vertex_ai/claude-3-haiku@20240307", + weak_model_name="vertex_ai/claude-3-5-haiku@20241022", ), # Cohere ModelSettings( From 85f23b3408191e044079f1d0ad3ab85fc7628371 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 09:06:56 -0800 Subject: [PATCH 10/53] copy --- aider/website/assets/sample-analytics.jsonl | 46 +++++++++++++ .../website/docs/config/adv-model-settings.md | 68 +++++-------------- 2 files changed, 63 insertions(+), 51 deletions(-) diff --git a/aider/website/assets/sample-analytics.jsonl b/aider/website/assets/sample-analytics.jsonl index 9c1b66864..05753bb89 100644 --- a/aider/website/assets/sample-analytics.jsonl +++ b/aider/website/assets/sample-analytics.jsonl @@ -483,3 +483,49 @@ {"event": "cli session", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/REDACTED", "edit_format": "whole", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730754176} {"event": "message_send", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/REDACTED", "edit_format": "whole", "prompt_tokens": 593, "completion_tokens": 53, "total_tokens": 646, "cost": 0.000858, "total_cost": 0.000858, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730754179} {"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818364} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818452} +{"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818452} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818654} +{"event": "cli session", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818656} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 4733, "completion_tokens": 745, "total_tokens": 5478, "cost": 0.025374, "total_cost": 0.025374, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818718} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.61.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818841} +{"event": "cli session", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.61.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818842} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818882} +{"event": "cli session", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818884} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 4657, "completion_tokens": 83, "total_tokens": 4740, "cost": 0.015216, "total_cost": 0.015216, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818900} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818904} +{"event": "command_clear", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818907} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 5113, "completion_tokens": 1484, "total_tokens": 6597, "cost": 0.037599, "total_cost": 0.052815, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730818940} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 6654, "completion_tokens": 435, "total_tokens": 7089, "cost": 0.026487, "total_cost": 0.079302, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730819050} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825144} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825234} +{"event": "cli session", "properties": {"main_model": "gpt-4o-mini", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "gpt-4o-mini", "edit_format": "whole", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825235} +{"event": "message_send", "properties": {"main_model": "gpt-4o-mini", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "gpt-4o-mini", "edit_format": "whole", "prompt_tokens": 674, "completion_tokens": 23, "total_tokens": 697, "cost": 0.00011489999999999999, "total_cost": 0.00011489999999999999, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825238} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825250} +{"event": "cli session", "properties": {"main_model": "None", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "None", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825252} +{"event": "message_send", "properties": {"main_model": "None", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "None", "edit_format": "diff", "prompt_tokens": 2185, "completion_tokens": 56, "total_tokens": 2241, "cost": 0.0024649999999999997, "total_cost": 0.0024649999999999997, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825255} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825273} +{"event": "cli session", "properties": {"main_model": "None", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "None", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825275} +{"event": "message_send", "properties": {"main_model": "None", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "None", "edit_format": "diff", "prompt_tokens": 4601, "completion_tokens": 0, "total_tokens": 4601, "cost": 0.004601, "total_cost": 0.004601, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825277} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825280} +{"event": "command_reset", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825329} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825344} +{"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825345} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825356} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825371} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 12023, "completion_tokens": 494, "total_tokens": 12517, "cost": 0.043479000000000004, "total_cost": 0.122781, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825392} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825584} +{"event": "model warning", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/REDACTED", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825586} +{"event": "cli session", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/REDACTED", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825588} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825603} +{"event": "message_send", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/REDACTED", "edit_format": "whole", "prompt_tokens": 406, "completion_tokens": 57, "total_tokens": 463, "cost": 0.000691, "total_cost": 0.000691, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825607} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825613} +{"event": "message_send", "properties": {"main_model": "openrouter/anthropic/claude-3.5-sonnet", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/anthropic/claude-3.5-sonnet", "edit_format": "diff", "prompt_tokens": 4608, "completion_tokens": 52, "total_tokens": 4660, "cost": 0.014603999999999999, "total_cost": 0.014603999999999999, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825618} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825641} +{"event": "model warning", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/REDACTED", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825643} +{"event": "message_send", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/REDACTED", "edit_format": "whole", "prompt_tokens": 406, "completion_tokens": 79, "total_tokens": 485, "cost": 0.0, "total_cost": 0.0, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825648} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825746} +{"event": "model warning", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/REDACTED", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825748} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825774} +{"event": "model warning", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/REDACTED", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825775} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730826090} diff --git a/aider/website/docs/config/adv-model-settings.md b/aider/website/docs/config/adv-model-settings.md index 7ffcb5bca..4886741bf 100644 --- a/aider/website/docs/config/adv-model-settings.md +++ b/aider/website/docs/config/adv-model-settings.md @@ -400,7 +400,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: claude-3-haiku-20240307 + weak_model_name: claude-3-5-haiku-20241022 - cache_control: false caches_by_default: false edit_format: diff @@ -416,7 +416,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: openrouter/anthropic/claude-3-haiku + weak_model_name: openrouter/anthropic/claude-3-5-haiku - cache_control: false caches_by_default: false edit_format: whole @@ -432,7 +432,7 @@ cog.out("```\n") use_repo_map: false use_system_prompt: true use_temperature: true - weak_model_name: claude-3-haiku-20240307 + weak_model_name: claude-3-5-haiku-20241022 - cache_control: true caches_by_default: false edit_format: diff @@ -451,7 +451,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: claude-3-haiku-20240307 + weak_model_name: claude-3-5-haiku-20241022 - cache_control: true caches_by_default: false edit_format: diff @@ -470,7 +470,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: anthropic/claude-3-haiku-20240307 + weak_model_name: anthropic/claude-3-5-haiku-20241022 - cache_control: true caches_by_default: false edit_format: diff @@ -489,7 +489,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: anthropic/claude-3-haiku-20240307 + weak_model_name: anthropic/claude-3-5-haiku-20241022 - cache_control: true caches_by_default: false edit_format: diff @@ -508,7 +508,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: anthropic/claude-3-haiku-20240307 + weak_model_name: anthropic/claude-3-5-haiku-20241022 - cache_control: true caches_by_default: false edit_format: diff @@ -527,7 +527,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: claude-3-haiku-20240307 + weak_model_name: claude-3-5-haiku-20241022 - cache_control: true caches_by_default: false edit_format: whole @@ -560,7 +560,7 @@ cog.out("```\n") reminder: user send_undo_reply: false streaming: true - use_repo_map: false + use_repo_map: true use_system_prompt: true use_temperature: true weak_model_name: anthropic/claude-3-5-haiku-20241022 @@ -578,7 +578,7 @@ cog.out("```\n") reminder: user send_undo_reply: false streaming: true - use_repo_map: false + use_repo_map: true use_system_prompt: true use_temperature: true weak_model_name: claude-3-5-haiku-20241022 @@ -595,44 +595,10 @@ cog.out("```\n") reminder: user send_undo_reply: false streaming: true - use_repo_map: false + use_repo_map: true use_system_prompt: true use_temperature: true weak_model_name: vertex_ai/claude-3-5-haiku@20241022 -- cache_control: true - caches_by_default: false - edit_format: diff - editor_edit_format: null - editor_model_name: null - examples_as_sys_msg: false - extra_params: - max_tokens: 4096 - lazy: false - name: openrouter/anthropic/claude-3.5-haiku - reminder: user - send_undo_reply: false - streaming: true - use_repo_map: false - use_system_prompt: true - use_temperature: true - weak_model_name: openrouter/anthropic/claude-3.5-haiku -- cache_control: true - caches_by_default: false - edit_format: diff - editor_edit_format: null - editor_model_name: null - examples_as_sys_msg: false - extra_params: - max_tokens: 4096 - lazy: false - name: openrouter/anthropic/claude-3.5-haiku:beta - reminder: user - send_undo_reply: false - streaming: true - use_repo_map: false - use_system_prompt: true - use_temperature: true - weak_model_name: openrouter/anthropic/claude-3.5-haiku:beta - cache_control: true caches_by_default: false edit_format: whole @@ -667,7 +633,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: openrouter/anthropic/claude-3-haiku + weak_model_name: openrouter/anthropic/claude-3-5-haiku - cache_control: true caches_by_default: false edit_format: diff @@ -684,7 +650,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: openrouter/anthropic/claude-3-haiku:beta + weak_model_name: openrouter/anthropic/claude-3-5-haiku:beta - cache_control: false caches_by_default: false edit_format: diff @@ -701,7 +667,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: vertex_ai/claude-3-haiku@20240307 + weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - cache_control: false caches_by_default: false edit_format: diff @@ -718,7 +684,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: vertex_ai/claude-3-haiku@20240307 + weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - cache_control: false caches_by_default: false edit_format: diff @@ -734,7 +700,7 @@ cog.out("```\n") use_repo_map: true use_system_prompt: true use_temperature: true - weak_model_name: vertex_ai/claude-3-haiku@20240307 + weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - cache_control: false caches_by_default: false edit_format: whole @@ -750,7 +716,7 @@ cog.out("```\n") use_repo_map: false use_system_prompt: true use_temperature: true - weak_model_name: vertex_ai/claude-3-haiku@20240307 + weak_model_name: vertex_ai/claude-3-5-haiku@20241022 - cache_control: false caches_by_default: false edit_format: whole From c71a92ac845bea652e6fb29968b8449ec6ee69ea Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 09:14:01 -0800 Subject: [PATCH 11/53] fix: handle empty original content when creating new files --- aider/coders/editblock_coder.py | 5 ++++- tests/basic/test_editblock.py | 40 +++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) diff --git a/aider/coders/editblock_coder.py b/aider/coders/editblock_coder.py index 316205e72..ecd94e47a 100644 --- a/aider/coders/editblock_coder.py +++ b/aider/coders/editblock_coder.py @@ -52,7 +52,10 @@ class EditBlockCoder(Coder): content = self.io.read_text(full_path) new_content = do_replace(full_path, content, original, updated, self.fence) - if not new_content: + # If the edit failed, and + # this is not a "create a new file" with an empty original... + # https://github.com/Aider-AI/aider/issues/2258 + if not new_content and original.strip(): # try patching any of the other files in the chat for full_path in self.abs_fnames: content = self.io.read_text(full_path) diff --git a/tests/basic/test_editblock.py b/tests/basic/test_editblock.py index 4b3817b1c..e018c12b4 100644 --- a/tests/basic/test_editblock.py +++ b/tests/basic/test_editblock.py @@ -10,6 +10,7 @@ from aider.coders import editblock_coder as eb from aider.dump import dump # noqa: F401 from aider.io import InputOutput from aider.models import Model +from aider.utils import GitTemporaryDirectory class TestUtils(unittest.TestCase): @@ -341,6 +342,45 @@ These changes replace the `subprocess.run` patches with `subprocess.check_output result = eb.replace_most_similar_chunk(whole, part, replace) self.assertEqual(result, expected_output) + def test_create_new_file_with_other_file_in_chat(self): + # https://github.com/Aider-AI/aider/issues/2258 + with GitTemporaryDirectory(): + # Create a few temporary files + file1 = "file.txt" + + with open(file1, "w", encoding="utf-8") as f: + f.write("one\ntwo\nthree\n") + + files = [file1] + + # Initialize the Coder object with the mocked IO and mocked repo + coder = Coder.create(self.GPT35, "diff", io=InputOutput(yes=True), fnames=files) + + def mock_send(*args, **kwargs): + coder.partial_response_content = f""" +Do this: + +newfile.txt +<<<<<<< SEARCH +======= +creating a new file +>>>>>>> REPLACE + +""" + coder.partial_response_function_call = dict() + return [] + + coder.send = mock_send + + # Call the run method with a message + coder.run(with_message="hi") + + content = Path(file1).read_text(encoding="utf-8") + self.assertEqual(content, "one\ntwo\nthree\n") + + content = Path("newfile.txt").read_text(encoding="utf-8") + self.assertEqual(content, "creating a new file\n") + def test_full_edit(self): # Create a few temporary files _, file1 = tempfile.mkstemp() From 538752d0cf22a6b284c29ae22ee3c8b546932e6c Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 11:42:30 -0800 Subject: [PATCH 12/53] test: add mock for sendchat.simple_send_with_retries in editblock test --- tests/basic/test_editblock.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/basic/test_editblock.py b/tests/basic/test_editblock.py index e018c12b4..de3a37fba 100644 --- a/tests/basic/test_editblock.py +++ b/tests/basic/test_editblock.py @@ -372,6 +372,9 @@ creating a new file coder.send = mock_send + def mock_sswr(*args, **kwargs): return "noop" + #ai mock sendchat.simple_send_with_retries with that ^^ mock! + # Call the run method with a message coder.run(with_message="hi") From f7c0c433c36c53cda5834b230010b24e86c1098b Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Tue, 5 Nov 2024 11:42:31 -0800 Subject: [PATCH 13/53] refactor: add mock for sendchat.simple_send_with_retries in test --- tests/basic/test_editblock.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/basic/test_editblock.py b/tests/basic/test_editblock.py index de3a37fba..ccc0a9ffd 100644 --- a/tests/basic/test_editblock.py +++ b/tests/basic/test_editblock.py @@ -373,9 +373,8 @@ creating a new file coder.send = mock_send def mock_sswr(*args, **kwargs): return "noop" - #ai mock sendchat.simple_send_with_retries with that ^^ mock! - - # Call the run method with a message + with patch("aider.sendchat.simple_send_with_retries", mock_sswr): + # Call the run method with a message coder.run(with_message="hi") content = Path(file1).read_text(encoding="utf-8") From 90730845de1a0dd25518403e57f79001fef411b4 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 11:43:04 -0800 Subject: [PATCH 14/53] style: fix indentation in test_editblock.py --- tests/basic/test_editblock.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/basic/test_editblock.py b/tests/basic/test_editblock.py index ccc0a9ffd..aa16c4de7 100644 --- a/tests/basic/test_editblock.py +++ b/tests/basic/test_editblock.py @@ -372,10 +372,11 @@ creating a new file coder.send = mock_send - def mock_sswr(*args, **kwargs): return "noop" + def mock_sswr(*args, **kwargs): + return "noop" + with patch("aider.sendchat.simple_send_with_retries", mock_sswr): - # Call the run method with a message - coder.run(with_message="hi") + coder.run(with_message="hi") content = Path(file1).read_text(encoding="utf-8") self.assertEqual(content, "one\ntwo\nthree\n") From 97051b9d403fec6546886c7a88715af3e5771686 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 11:54:27 -0800 Subject: [PATCH 15/53] refactor: Replace GitTemporaryDirectory with ChdirTemporaryDirectory --- tests/basic/test_editblock.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/basic/test_editblock.py b/tests/basic/test_editblock.py index aa16c4de7..1ac1e41b0 100644 --- a/tests/basic/test_editblock.py +++ b/tests/basic/test_editblock.py @@ -10,7 +10,7 @@ from aider.coders import editblock_coder as eb from aider.dump import dump # noqa: F401 from aider.io import InputOutput from aider.models import Model -from aider.utils import GitTemporaryDirectory +from aider.utils import ChdirTemporaryDirectory class TestUtils(unittest.TestCase): @@ -344,7 +344,7 @@ These changes replace the `subprocess.run` patches with `subprocess.check_output def test_create_new_file_with_other_file_in_chat(self): # https://github.com/Aider-AI/aider/issues/2258 - with GitTemporaryDirectory(): + with ChdirTemporaryDirectory(): # Create a few temporary files file1 = "file.txt" @@ -354,7 +354,9 @@ These changes replace the `subprocess.run` patches with `subprocess.check_output files = [file1] # Initialize the Coder object with the mocked IO and mocked repo - coder = Coder.create(self.GPT35, "diff", io=InputOutput(yes=True), fnames=files) + coder = Coder.create( + self.GPT35, "diff", use_git=False, io=InputOutput(yes=True), fnames=files + ) def mock_send(*args, **kwargs): coder.partial_response_content = f""" @@ -372,11 +374,7 @@ creating a new file coder.send = mock_send - def mock_sswr(*args, **kwargs): - return "noop" - - with patch("aider.sendchat.simple_send_with_retries", mock_sswr): - coder.run(with_message="hi") + coder.run(with_message="hi") content = Path(file1).read_text(encoding="utf-8") self.assertEqual(content, "one\ntwo\nthree\n") From b81f3e4f8d88df8273fcadeb040cb3d1ef90797e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 12:11:14 -0800 Subject: [PATCH 16/53] style: reorder chart canvas elements in blame.md --- aider/website/_includes/blame.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/website/_includes/blame.md b/aider/website/_includes/blame.md index 5c1866b47..3973ea812 100644 --- a/aider/website/_includes/blame.md +++ b/aider/website/_includes/blame.md @@ -1,5 +1,5 @@ - + From bf43c567d869ea655a705113a89ee099edd06a55 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 12:40:17 -0800 Subject: [PATCH 17/53] version bump to 0.62.1 --- aider/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/__init__.py b/aider/__init__.py index be63f7136..0f378a6ec 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -1,6 +1,6 @@ try: from aider.__version__ import __version__ except Exception: - __version__ = "0.62.1.dev" + __version__ = "0.62.1" __all__ = [__version__] From c7530085a6d808961265d00d1d75039ce57d253b Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 12:41:44 -0800 Subject: [PATCH 18/53] set version to 0.62.2.dev --- aider/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/__init__.py b/aider/__init__.py index 0f378a6ec..362e01532 100644 --- a/aider/__init__.py +++ b/aider/__init__.py @@ -1,6 +1,6 @@ try: from aider.__version__ import __version__ except Exception: - __version__ = "0.62.1" + __version__ = "0.62.2.dev" __all__ = [__version__] From 1520422cc326588899360a0ef4a956ad110561af Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 5 Nov 2024 15:39:17 -0800 Subject: [PATCH 19/53] copy --- aider/website/assets/sample-analytics.jsonl | 30 +++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/aider/website/assets/sample-analytics.jsonl b/aider/website/assets/sample-analytics.jsonl index 05753bb89..b66c373d3 100644 --- a/aider/website/assets/sample-analytics.jsonl +++ b/aider/website/assets/sample-analytics.jsonl @@ -529,3 +529,33 @@ {"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825774} {"event": "model warning", "properties": {"main_model": "openrouter/REDACTED", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "openrouter/REDACTED", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730825775} {"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730826090} +{"event": "command_reset", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730826167} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730826833} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730826902} +{"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730826902} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835152} +{"event": "cli session", "properties": {"main_model": "deepseek/deepseek-coder", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "deepseek/deepseek-coder", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835155} +{"event": "message_send", "properties": {"main_model": "deepseek/deepseek-coder", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "deepseek/deepseek-coder", "edit_format": "diff", "prompt_tokens": 4613, "completion_tokens": 147, "total_tokens": 4760, "cost": 0.0006869800000000001, "total_cost": 0.0006869800000000001, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835165} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835605} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835621} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 7077, "completion_tokens": 131, "total_tokens": 7208, "cost": 0.023196, "total_cost": 0.145977, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835629} +{"event": "command_reset", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835647} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 4650, "completion_tokens": 79, "total_tokens": 4729, "cost": 0.015135000000000001, "total_cost": 0.161112, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835652} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835659} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 7216, "completion_tokens": 202, "total_tokens": 7418, "cost": 0.024678000000000002, "total_cost": 0.18579, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835666} +{"event": "command_reset", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835725} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835729} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 7091, "completion_tokens": 179, "total_tokens": 7270, "cost": 0.023958, "total_cost": 0.20974800000000002, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835748} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835777} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835846} +{"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730835846} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730836461} +{"event": "command_reset", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730836569} +{"event": "command_reset", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730836572} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730837470} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730837568} +{"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730837568} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730839181} +{"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730839182} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730839281} +{"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730839282} From daef2eecdd4b26b6a96820b612fb2388195edcae Mon Sep 17 00:00:00 2001 From: Logan Attwood Date: Wed, 6 Nov 2024 12:28:24 -0400 Subject: [PATCH 20/53] Add Sonnet & Haiku ModelSettings for Bedrock --- aider/models.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/aider/models.py b/aider/models.py index 73b1d04ff..95a4483a0 100644 --- a/aider/models.py +++ b/aider/models.py @@ -299,6 +299,23 @@ MODEL_SETTINGS = [ cache_control=True, reminder="user", ), + ModelSettings( + "bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0", + "diff", + weak_model_name="bedrock/anthropic.claude-3-5-haiku-20241022-v1:0", + editor_model_name="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0", + editor_edit_format="editor-diff", + use_repo_map=True, + examples_as_sys_msg=True, + extra_params={ + "extra_headers": { + "anthropic-beta": ANTHROPIC_BETA_HEADER, + }, + "max_tokens": 8192, + }, + cache_control=True, + reminder="user", + ), ModelSettings( "anthropic/claude-3-5-sonnet-latest", "diff", @@ -357,6 +374,18 @@ MODEL_SETTINGS = [ }, cache_control=True, ), + ModelSettings( + "bedrock/anthropic.claude-3-5-haiku-20241022-v1:0", + "diff", + weak_model_name="bedrock/anthropic.claude-3-5-haiku-20241022-v1:0", + use_repo_map=True, + extra_params={ + "extra_headers": { + "anthropic-beta": ANTHROPIC_BETA_HEADER, + }, + }, + cache_control=True, + ), ModelSettings( "claude-3-5-haiku-20241022", "diff", From add9b83d3b68055b49e6e8ef51e2dfc2b99e8d86 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 6 Nov 2024 20:13:31 -0800 Subject: [PATCH 21/53] copy --- aider/website/docs/faq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/website/docs/faq.md b/aider/website/docs/faq.md index dfbb7942c..f7cf40cfe 100644 --- a/aider/website/docs/faq.md +++ b/aider/website/docs/faq.md @@ -30,7 +30,7 @@ current chat to build a compact Adding a bunch of files that are mostly irrelevant to the task at hand will often distract or confuse the LLM. The LLM will give worse coding results, and sometimese even fail to correctly edit files. -Addings extra files will also increase the token costs on your OpenAI invoice. +Addings extra files will also increase your token costs. Again, it's usually best to just add the files to the chat that will need to be modified. If you still wish to add lots of files to the chat, you can: From c84f2996ec6b301e031425f65e57f155fd64afbe Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Wed, 6 Nov 2024 20:13:38 -0800 Subject: [PATCH 22/53] copy --- aider/website/assets/sample-analytics.jsonl | 3 ++ .../website/docs/config/adv-model-settings.md | 37 +++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/aider/website/assets/sample-analytics.jsonl b/aider/website/assets/sample-analytics.jsonl index b66c373d3..881efcd7e 100644 --- a/aider/website/assets/sample-analytics.jsonl +++ b/aider/website/assets/sample-analytics.jsonl @@ -559,3 +559,6 @@ {"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730839182} {"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730839281} {"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730839282} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730850606} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730850628} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730850671} diff --git a/aider/website/docs/config/adv-model-settings.md b/aider/website/docs/config/adv-model-settings.md index 4886741bf..d6b710894 100644 --- a/aider/website/docs/config/adv-model-settings.md +++ b/aider/website/docs/config/adv-model-settings.md @@ -490,6 +490,25 @@ cog.out("```\n") use_system_prompt: true use_temperature: true weak_model_name: anthropic/claude-3-5-haiku-20241022 +- cache_control: true + caches_by_default: false + edit_format: diff + editor_edit_format: editor-diff + editor_model_name: bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0 + examples_as_sys_msg: true + extra_params: + extra_headers: + anthropic-beta: prompt-caching-2024-07-31 + max_tokens: 8192 + lazy: false + name: bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0 - cache_control: true caches_by_default: false edit_format: diff @@ -564,6 +583,24 @@ cog.out("```\n") use_system_prompt: true use_temperature: true weak_model_name: anthropic/claude-3-5-haiku-20241022 +- cache_control: true + caches_by_default: false + edit_format: diff + editor_edit_format: null + editor_model_name: null + examples_as_sys_msg: false + extra_params: + extra_headers: + anthropic-beta: prompt-caching-2024-07-31 + lazy: false + name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0 + reminder: user + send_undo_reply: false + streaming: true + use_repo_map: true + use_system_prompt: true + use_temperature: true + weak_model_name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0 - cache_control: true caches_by_default: false edit_format: diff From af0466ea839a003b92e667b91af63e418e4fa054 Mon Sep 17 00:00:00 2001 From: Jaap Buurman Date: Thu, 7 Nov 2024 13:18:24 +0100 Subject: [PATCH 23/53] Added Qwen2.5-7b-coder with the updated weights The Qwen team still calls it Qwen2.5, but as can be seen from the benchmarks the difference in performance compared to the old weights is pretty substantial. The GGUF version of this model made by Bartowski calls it 2.5.1 to differentiate it from the earlier version of the same model. --- aider/website/_data/edit_leaderboard.yml | 63 ++++++++++++++++-------- 1 file changed, 43 insertions(+), 20 deletions(-) diff --git a/aider/website/_data/edit_leaderboard.yml b/aider/website/_data/edit_leaderboard.yml index d247002a1..09d84630c 100644 --- a/aider/website/_data/edit_leaderboard.yml +++ b/aider/website/_data/edit_leaderboard.yml @@ -20,7 +20,7 @@ versions: 0.30.2-dev seconds_per_case: 32.4 total_cost: 13.8395 - + - dirname: 2024-03-06-16-42-00--claude3-sonnet-whole test_cases: 133 model: claude-3-sonnet-20240229 @@ -43,7 +43,7 @@ versions: 0.25.1-dev seconds_per_case: 23.1 total_cost: 0.0000 - + - dirname: 2024-05-03-20-47-24--gemini-1.5-pro-diff-fenced test_cases: 133 model: gemini-1.5-pro-latest @@ -88,7 +88,7 @@ versions: 0.33.1-dev seconds_per_case: 6.5 total_cost: 0.5032 - + - dirname: 2023-11-06-21-23-59--gpt-3.5-turbo-0301 test_cases: 133 model: gpt-3.5-turbo-0301 @@ -111,7 +111,7 @@ versions: 0.16.4-dev seconds_per_case: 6.5 total_cost: 0.4822 - + - dirname: 2023-11-07-02-41-07--gpt-3.5-turbo-0613 test_cases: 133 model: gpt-3.5-turbo-0613 @@ -155,7 +155,7 @@ versions: 0.30.2-dev seconds_per_case: 5.3 total_cost: 0.3261 - + - dirname: 2024-01-25-23-37-15--jan-exercism-gpt-4-0125-preview-udiff test_cases: 133 model: gpt-4-0125-preview @@ -178,7 +178,7 @@ versions: 0.22.1-dev seconds_per_case: 44.8 total_cost: 14.6428 - + - dirname: 2024-05-04-15-07-30--redo-gpt-4-0314-diff-reminder-rules test_cases: 133 model: gpt-4-0314 @@ -201,7 +201,7 @@ versions: 0.31.2-dev seconds_per_case: 19.8 total_cost: 16.2689 - + - dirname: 2023-12-16-21-24-28--editblock-gpt-4-0613-actual-main test_cases: 133 model: gpt-4-0613 @@ -228,7 +228,7 @@ - dirname: 2024-05-08-21-16-03--may-gpt-4-1106-preview-udiff test_cases: 133 model: gpt-4-1106-preview - released: 2023-11-06 + released: 2023-11-06 edit_format: udiff commit_hash: 87664dc pass_rate_1: 51.9 @@ -247,7 +247,7 @@ versions: 0.33.1-dev seconds_per_case: 20.4 total_cost: 6.6061 - + - dirname: 2024-05-01-02-09-20--gpt-4-turbo-examples test_cases: 133 model: gpt-4-turbo-2024-04-09 (udiff) @@ -270,7 +270,7 @@ versions: 0.30.2-dev seconds_per_case: 22.8 total_cost: 6.3337 - + - dirname: 2024-05-03-22-24-48--openrouter--llama3-diff-examples-sys-msg test_cases: 132 model: llama3-70b-8192 @@ -293,7 +293,7 @@ versions: 0.31.2-dev seconds_per_case: 14.5 total_cost: 0.4311 - + - dirname: 2024-05-06-18-31-08--command-r-plus-whole-final test_cases: 133 model: command-r-plus @@ -316,11 +316,11 @@ versions: 0.31.2-dev seconds_per_case: 22.9 total_cost: 2.7494 - + - dirname: 2024-05-07-20-32-37--qwen1.5-110b-chat-whole test_cases: 133 model: qwen1.5-110b-chat - released: 2024-02-04 + released: 2024-02-04 edit_format: whole commit_hash: 70b1c0c pass_rate_1: 30.8 @@ -339,7 +339,7 @@ versions: 0.31.2-dev seconds_per_case: 46.9 total_cost: 0.0000 - + - dirname: 2024-05-07-20-57-04--wizardlm-2-8x22b-whole test_cases: 133 model: WizardLM-2 8x22B @@ -384,7 +384,7 @@ versions: 0.34.1-dev seconds_per_case: 6.0 total_cost: 0.0000 - + - dirname: 2024-04-12-22-18-20--gpt-4-turbo-2024-04-09-plain-diff test_cases: 33 model: gpt-4-turbo-2024-04-09 (diff) @@ -568,7 +568,7 @@ versions: 0.42.1-dev seconds_per_case: 17.6 total_cost: 3.6346 - + - dirname: 2024-07-01-21-41-48--haiku-whole test_cases: 133 model: claude-3-haiku-20240307 @@ -1131,7 +1131,7 @@ versions: 0.56.1.dev seconds_per_case: 80.9 total_cost: 63.9190 - + - dirname: 2024-09-19-16-58-29--qwen2.5-coder:7b-instruct-q8_0 test_cases: 133 model: qwen2.5-coder:7b-instruct-q8_0 @@ -1154,7 +1154,7 @@ versions: 0.56.0 seconds_per_case: 9.3 total_cost: 0.0000 - + - dirname: 2024-09-20-20-20-19--qwen-2.5-72b-instruct-diff test_cases: 133 model: qwen-2.5-72b-instruct (bf16) @@ -1458,7 +1458,7 @@ versions: 0.58.1.dev seconds_per_case: 63.7 total_cost: 0.0000 - + - dirname: 2024-10-01-16-50-09--hermes3-whole-4 test_cases: 133 model: ollama/hermes3 @@ -1633,4 +1633,27 @@ date: 2024-11-04 versions: 0.61.1.dev seconds_per_case: 18.4 - total_cost: 0.0000 \ No newline at end of file + total_cost: 0.0000 + +- dirname: 2024-11-07-06-15-36--Qwen2.5.1-Coder-7B-Instruct-GGUF:Q8_0-32k-whole + test_cases: 133 + model: ollama/Qwen2.5.1-Coder-7B-Instruct-GGUF:Q8_0-32k + edit_format: whole + commit_hash: e76704e + pass_rate_1: 52.6 + pass_rate_2: 63.9 + percent_cases_well_formed: 100.0 + error_outputs: 0 + num_malformed_responses: 0 + num_with_malformed_responses: 0 + user_asks: 4 + lazy_comments: 0 + syntax_errors: 0 + indentation_errors: 0 + exhausted_context_windows: 0 + test_timeouts: 1 + command: aider --model ollama/Qwen2.5.1-Coder-7B-Instruct-GGUF:Q8_0-32k + date: 2024-11-07 + versions: 0.59.2.dev + seconds_per_case: 18.2 + total_cost: 0.0000 From 2cf93ccb54022fec16d55759928ef54d89120cbe Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 10:26:31 -0800 Subject: [PATCH 24/53] refactor: simplify URL opening confirmation prompt --- aider/coders/base_coder.py | 3 ++- aider/io.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 1beed7a45..0e297902a 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -829,7 +829,8 @@ class Coder: urls = list(set(url_pattern.findall(text))) # Use set to remove duplicates for url in urls: url = url.rstrip(".',\"") - if self.io.confirm_ask("Open URL for more info about this error?", subject=url): + #ai refactor this into a io.offer_url() function! + if self.io.confirm_ask("Open URL for more info?", subject=url): webbrowser.open(url) return urls diff --git a/aider/io.py b/aider/io.py index 5e27a267a..a9a3a3edd 100644 --- a/aider/io.py +++ b/aider/io.py @@ -1,3 +1,4 @@ +#ai import base64 import os from collections import defaultdict From 0368c3fae91679d3eac7652bd8e81eb4007cc2db Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 10:26:33 -0800 Subject: [PATCH 25/53] refactor: extract URL opening functionality into dedicated io.offer_url method --- aider/coders/base_coder.py | 4 +--- aider/io.py | 9 +++++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 0e297902a..540828a43 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -829,9 +829,7 @@ class Coder: urls = list(set(url_pattern.findall(text))) # Use set to remove duplicates for url in urls: url = url.rstrip(".',\"") - #ai refactor this into a io.offer_url() function! - if self.io.confirm_ask("Open URL for more info?", subject=url): - webbrowser.open(url) + self.io.offer_url(url) return urls def check_for_urls(self, inp: str) -> List[str]: diff --git a/aider/io.py b/aider/io.py index a9a3a3edd..17d3e70b1 100644 --- a/aider/io.py +++ b/aider/io.py @@ -485,6 +485,15 @@ class InputOutput: hist = "\n" + content.strip() + "\n\n" self.append_chat_history(hist) + def offer_url(self, url, prompt="Open URL for more info?"): + """Offer to open a URL in the browser, returns True if opened.""" + if url.rstrip(".',\"") in self.never_prompts: + return False + if self.confirm_ask(prompt, subject=url, allow_never=True): + webbrowser.open(url) + return True + return False + def confirm_ask( self, question, From 4d24dbc661772dd3291e6c078032eb2b8d6b9abb Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 10:26:41 -0800 Subject: [PATCH 26/53] style: fix linting issues in io.py header comment --- aider/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/io.py b/aider/io.py index 17d3e70b1..bee775776 100644 --- a/aider/io.py +++ b/aider/io.py @@ -1,4 +1,4 @@ -#ai +# ai import base64 import os from collections import defaultdict From e475f3d75221e6d630581729d1ea916cb40f7966 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 10:26:54 -0800 Subject: [PATCH 27/53] refactor: move webbrowser import to io.py and remove from base_coder.py --- aider/coders/base_coder.py | 1 - aider/io.py | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 540828a43..7fac64cbf 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -13,7 +13,6 @@ import sys import threading import time import traceback -import webbrowser from collections import defaultdict from datetime import datetime from json.decoder import JSONDecodeError diff --git a/aider/io.py b/aider/io.py index bee775776..c200ed7b6 100644 --- a/aider/io.py +++ b/aider/io.py @@ -1,6 +1,7 @@ # ai import base64 import os +import webbrowser from collections import defaultdict from dataclasses import dataclass from datetime import datetime From a848933875add9c62098e9f2d428cdb3e637ad82 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 10:30:38 -0800 Subject: [PATCH 28/53] chore: add TODO comment for refactoring URL handling --- aider/main.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/aider/main.py b/aider/main.py index 514393164..04d37442c 100644 --- a/aider/main.py +++ b/aider/main.py @@ -29,6 +29,8 @@ from aider.versioncheck import check_version, install_from_main_branch, install_ from .dump import dump # noqa: F401 +#ai change all the confirm_ask/webbrowser.open calls to use io.offer_url! + def check_config_files_for_yes(config_files): found = False for config_file in config_files: From 7761bccffe52a59dbb7a3870766754f9412d9ee8 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 10:30:41 -0800 Subject: [PATCH 29/53] refactor: replace confirm_ask/webbrowser.open with io.offer_url --- aider/main.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/aider/main.py b/aider/main.py index 04d37442c..2ceeebd2a 100644 --- a/aider/main.py +++ b/aider/main.py @@ -369,8 +369,7 @@ def sanity_check_repo(repo, io): io.tool_error("Aider only works with git repos with version number 1 or 2.") io.tool_output("You may be able to convert your repo: git update-index --index-version=2") io.tool_output("Or run aider --no-git to proceed without using git.") - if io.confirm_ask("Open documentation url for more info?", subject=urls.git_index_version): - webbrowser.open(urls.git_index_version) + io.offer_url(urls.git_index_version, "Open documentation url for more info?") return False io.tool_error("Unable to read git repository, it may be corrupt?") @@ -643,10 +642,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F io.tool_output("You can skip this check with --no-show-model-warnings") try: - if io.confirm_ask( - "Open documentation url for more info?", subject=urls.model_warnings - ): - webbrowser.open(urls.model_warnings) + io.offer_url(urls.model_warnings, "Open documentation url for more info?") io.tool_output() except KeyboardInterrupt: return 1 @@ -871,10 +867,7 @@ def check_and_load_imports(io, verbose=False): except Exception as err: io.tool_error(str(err)) io.tool_output("Error loading required imports. Did you install aider properly?") - if io.confirm_ask( - "Open documentation url for more info?", subject=urls.install_properly - ): - webbrowser.open(urls.install_properly) + io.offer_url(urls.install_properly, "Open documentation url for more info?") sys.exit(1) From 9eead8a904b8f90bac76b68a24e3704b281620fd Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 10:30:45 -0800 Subject: [PATCH 30/53] style: Fix comment formatting and whitespace --- aider/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/main.py b/aider/main.py index 2ceeebd2a..f7002147e 100644 --- a/aider/main.py +++ b/aider/main.py @@ -28,8 +28,8 @@ from aider.versioncheck import check_version, install_from_main_branch, install_ from .dump import dump # noqa: F401 +# ai change all the confirm_ask/webbrowser.open calls to use io.offer_url! -#ai change all the confirm_ask/webbrowser.open calls to use io.offer_url! def check_config_files_for_yes(config_files): found = False From 64c48f21511c9b48d58ac7742095dfac3cc66723 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 11:23:02 -0800 Subject: [PATCH 31/53] refactor: remove unused webbrowser import --- aider/main.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aider/main.py b/aider/main.py index f7002147e..ccef50d50 100644 --- a/aider/main.py +++ b/aider/main.py @@ -5,7 +5,6 @@ import re import sys import threading import traceback -import webbrowser from pathlib import Path import git From a66f31dc87707302a1350bbe06bd972097121b42 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 11:28:52 -0800 Subject: [PATCH 32/53] bugfix --- aider/repomap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aider/repomap.py b/aider/repomap.py index e4f11a432..0ec4f710a 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -28,7 +28,7 @@ from tree_sitter_languages import get_language, get_parser # noqa: E402 Tag = namedtuple("Tag", "rel_fname fname line name kind".split()) -SQLITE_ERRORS = (sqlite3.OperationalError, sqlite3.DatabaseError) +SQLITE_ERRORS = (sqlite3.OperationalError, sqlite3.DatabaseError, OSError) class RepoMap: @@ -197,7 +197,7 @@ class RepoMap: self.TAGS_CACHE = new_cache return - except (SQLITE_ERRORS, OSError) as e: + except SQLITE_ERRORS as e: # If anything goes wrong, warn and fall back to dict self.io.tool_warning( f"Unable to use tags cache at {path}, falling back to memory cache" From 42aac55b82536595802c8a9dd81bf6956bbe8c58 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 11:29:05 -0800 Subject: [PATCH 33/53] use offer_url --- aider/coders/base_coder.py | 4 +--- aider/io.py | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 7fac64cbf..d38a70026 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1372,11 +1372,9 @@ class Coder: res.append("- Use /clear to clear the chat history.") res.append("- Break your code into smaller source files.") - res.append("") - res.append(f"For more info: {urls.token_limits}") - res = "".join([line + "\n" for line in res]) self.io.tool_error(res) + self.io.offer_url(urls.token_limits) def lint_edited(self, fnames): res = "" diff --git a/aider/io.py b/aider/io.py index c200ed7b6..f3b1f9737 100644 --- a/aider/io.py +++ b/aider/io.py @@ -1,4 +1,3 @@ -# ai import base64 import os import webbrowser @@ -488,7 +487,7 @@ class InputOutput: def offer_url(self, url, prompt="Open URL for more info?"): """Offer to open a URL in the browser, returns True if opened.""" - if url.rstrip(".',\"") in self.never_prompts: + if url in self.never_prompts: return False if self.confirm_ask(prompt, subject=url, allow_never=True): webbrowser.open(url) From d43a01f18262db646a0dd14c75b39ccd67325666 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 11:29:47 -0800 Subject: [PATCH 34/53] cleanup --- aider/main.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/aider/main.py b/aider/main.py index ccef50d50..179d4560f 100644 --- a/aider/main.py +++ b/aider/main.py @@ -27,8 +27,6 @@ from aider.versioncheck import check_version, install_from_main_branch, install_ from .dump import dump # noqa: F401 -# ai change all the confirm_ask/webbrowser.open calls to use io.offer_url! - def check_config_files_for_yes(config_files): found = False From ae970cf2da4f042aff2839e7620595c9be7a68b2 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 11:35:40 -0800 Subject: [PATCH 35/53] fix: Update webbrowser patch to use correct module path --- tests/basic/test_main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index 6fa4a9ed6..1b85cfd22 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -32,7 +32,7 @@ class TestMain(TestCase): os.environ["HOME"] = self.homedir_obj.name self.input_patcher = patch("builtins.input", return_value=None) self.mock_input = self.input_patcher.start() - self.webbrowser_patcher = patch("webbrowser.open") + self.webbrowser_patcher = patch("aider.io.webbrowser.open") self.mock_webbrowser = self.webbrowser_patcher.start() def tearDown(self): From 1cd373c0a52ebd1125a36db2db54bf16f99fd899 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 11:47:33 -0800 Subject: [PATCH 36/53] test: fix git index version test to use offer_url instead of confirm_ask --- tests/basic/test_sanity_check_repo.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/basic/test_sanity_check_repo.py b/tests/basic/test_sanity_check_repo.py index 3ba18e2f3..48cce77f3 100644 --- a/tests/basic/test_sanity_check_repo.py +++ b/tests/basic/test_sanity_check_repo.py @@ -2,7 +2,8 @@ import os import shutil import struct from unittest import mock - +#ai fix: FAILED tests/basic/test_sanity_check_repo.py::test_git_index_version_greater_than_2 - AssertionError: confirm_ask('Open documentation url for more info?', subject='https://github.com/Aid...! +# it now calls offer_url, not confirm ask import pytest from git import GitError, Repo From c96e3326bc82370ca3cbb38b4eba8d6cc7570bde Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 11:47:35 -0800 Subject: [PATCH 37/53] fix: update test to check for offer_url instead of confirm_ask --- tests/basic/test_sanity_check_repo.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/basic/test_sanity_check_repo.py b/tests/basic/test_sanity_check_repo.py index 48cce77f3..43bdc53cb 100644 --- a/tests/basic/test_sanity_check_repo.py +++ b/tests/basic/test_sanity_check_repo.py @@ -2,8 +2,6 @@ import os import shutil import struct from unittest import mock -#ai fix: FAILED tests/basic/test_sanity_check_repo.py::test_git_index_version_greater_than_2 - AssertionError: confirm_ask('Open documentation url for more info?', subject='https://github.com/Aid...! -# it now calls offer_url, not confirm ask import pytest from git import GitError, Repo @@ -128,8 +126,8 @@ def test_git_index_version_greater_than_2(mock_browser, create_repo, mock_io): "You may be able to convert your repo: git update-index --index-version=2" ) mock_io.tool_output.assert_any_call("Or run aider --no-git to proceed without using git.") - mock_io.confirm_ask.assert_any_call( - "Open documentation url for more info?", subject=urls.git_index_version + mock_io.offer_url.assert_any_call( + "Open documentation url for more info?", urls.git_index_version ) From cf5733b237fa48f778944f6c00acff1ba7d44936 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 11:47:39 -0800 Subject: [PATCH 38/53] style: fix import order in test_sanity_check_repo.py --- tests/basic/test_sanity_check_repo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/basic/test_sanity_check_repo.py b/tests/basic/test_sanity_check_repo.py index 43bdc53cb..7c03e5053 100644 --- a/tests/basic/test_sanity_check_repo.py +++ b/tests/basic/test_sanity_check_repo.py @@ -2,6 +2,7 @@ import os import shutil import struct from unittest import mock + import pytest from git import GitError, Repo From 2962e51daca635b91d9c41cf93a9fa30bf8cb530 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 11:48:17 -0800 Subject: [PATCH 39/53] test: Add webbrowser patching to TestCoder and fix argument order in test_sanity_check_repo --- tests/basic/test_coder.py | 2 ++ tests/basic/test_sanity_check_repo.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/basic/test_coder.py b/tests/basic/test_coder.py index a5172cbc1..9456c61c0 100644 --- a/tests/basic/test_coder.py +++ b/tests/basic/test_coder.py @@ -17,6 +17,8 @@ from aider.utils import GitTemporaryDirectory class TestCoder(unittest.TestCase): def setUp(self): self.GPT35 = Model("gpt-3.5-turbo") + self.webbrowser_patcher = patch("aider.io.webbrowser.open") + self.mock_webbrowser = self.webbrowser_patcher.start() def test_allowed_to_edit(self): with GitTemporaryDirectory(): diff --git a/tests/basic/test_sanity_check_repo.py b/tests/basic/test_sanity_check_repo.py index 7c03e5053..860572ec5 100644 --- a/tests/basic/test_sanity_check_repo.py +++ b/tests/basic/test_sanity_check_repo.py @@ -128,7 +128,8 @@ def test_git_index_version_greater_than_2(mock_browser, create_repo, mock_io): ) mock_io.tool_output.assert_any_call("Or run aider --no-git to proceed without using git.") mock_io.offer_url.assert_any_call( - "Open documentation url for more info?", urls.git_index_version + urls.git_index_version, + "Open documentation url for more info?", ) From 728f4a0f81834cb9475ddec711d4a689027ff90d Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 11:54:53 -0800 Subject: [PATCH 40/53] copy --- aider/website/assets/sample-analytics.jsonl | 56 +++++++++++++++++++++ aider/website/docs/leaderboards/index.md | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) diff --git a/aider/website/assets/sample-analytics.jsonl b/aider/website/assets/sample-analytics.jsonl index 881efcd7e..cf09949b6 100644 --- a/aider/website/assets/sample-analytics.jsonl +++ b/aider/website/assets/sample-analytics.jsonl @@ -562,3 +562,59 @@ {"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730850606} {"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730850628} {"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730850671} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730952885} +{"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1730952886} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731003938} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731003955} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731003977} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 22688, "completion_tokens": 350, "total_tokens": 23038, "cost": 0.073314, "total_cost": 0.28306200000000004, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731003989} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 23909, "completion_tokens": 208, "total_tokens": 24117, "cost": 0.074847, "total_cost": 0.35790900000000003, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731004012} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731004099} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731004134} +{"event": "command_drop", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731004203} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731004216} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 11315, "completion_tokens": 297, "total_tokens": 11612, "cost": 0.038400000000000004, "total_cost": 0.396309, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731004236} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 11339, "completion_tokens": 84, "total_tokens": 11423, "cost": 0.035276999999999996, "total_cost": 0.431586, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007380} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007384} +{"event": "model warning", "properties": {"main_model": "None", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "None", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007387} +{"event": "cli session", "properties": {"main_model": "None", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "None", "edit_format": "whole", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007391} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007412} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007458} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007531} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007542} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007602} +{"event": "cli session", "properties": {"main_model": "gpt-4o-2024-08-06", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "gpt-4o-2024-08-06", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007604} +{"event": "message_send", "properties": {"main_model": "gpt-4o-2024-08-06", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "gpt-4o-2024-08-06", "edit_format": "diff", "prompt_tokens": 4630, "completion_tokens": 12, "total_tokens": 4642, "cost": 0.011695, "total_cost": 0.011695, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007609} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007614} +{"event": "cli session", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007616} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 4637, "completion_tokens": 89, "total_tokens": 4726, "cost": 0.015246, "total_cost": 0.015246, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007620} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007631} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007654} +{"event": "cli session", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007655} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 2175, "completion_tokens": 75, "total_tokens": 2250, "cost": 0.0076500000000000005, "total_cost": 0.0076500000000000005, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007660} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007674} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731007733} +{"event": "command_drop", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008017} +{"event": "command_reset", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008018} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 4609, "completion_tokens": 118, "total_tokens": 4727, "cost": 0.015597000000000001, "total_cost": 0.44718300000000005, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008044} +{"event": "command_reset", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008050} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008053} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 9093, "completion_tokens": 174, "total_tokens": 9267, "cost": 0.029889000000000002, "total_cost": 0.47707200000000005, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008063} +{"event": "command_ask", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008066} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "ask", "prompt_tokens": 7163, "completion_tokens": 149, "total_tokens": 7312, "cost": 0.023724000000000002, "total_cost": 0.500796, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008071} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008091} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008122} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008124} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008125} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008135} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008162} +{"event": "cli session", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-haiku-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008163} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008178} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008738} +{"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008738} +{"event": "command_reset", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008808} +{"event": "command_add", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008815} +{"event": "message_send", "properties": {"main_model": "claude-3-5-sonnet-20241022", "weak_model": "claude-3-5-sonnet-20241022", "editor_model": "claude-3-5-sonnet-20241022", "edit_format": "diff", "prompt_tokens": 4879, "completion_tokens": 279, "total_tokens": 5158, "cost": 0.018822000000000002, "total_cost": 0.519618, "python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.1.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008851} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008891} +{"event": "launched", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008957} +{"event": "gui session", "properties": {"python_version": "3.12.6", "os_platform": "Darwin", "os_release": "23.6.0", "machine": "x86_64", "aider_version": "0.62.2.dev"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1731008958} diff --git a/aider/website/docs/leaderboards/index.md b/aider/website/docs/leaderboards/index.md index 0ccbbefbb..7563bec64 100644 --- a/aider/website/docs/leaderboards/index.md +++ b/aider/website/docs/leaderboards/index.md @@ -318,6 +318,6 @@ mod_dates = [get_last_modified_date(file) for file in files] latest_mod_date = max(mod_dates) cog.out(f"{latest_mod_date.strftime('%B %d, %Y.')}") ]]]--> -November 04, 2024. +November 07, 2024.

From 62e93d4002bed4d08447206c29ac378166db89af Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 12:19:41 -0800 Subject: [PATCH 41/53] feat: add custom exceptions module --- aider/exceptions.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 aider/exceptions.py diff --git a/aider/exceptions.py b/aider/exceptions.py new file mode 100644 index 000000000..b615924f3 --- /dev/null +++ b/aider/exceptions.py @@ -0,0 +1,35 @@ + + +def retry_exceptions(): + import httpx + import openai + + return ( + # httpx + httpx.ConnectError, + httpx.RemoteProtocolError, + httpx.ReadTimeout, + # + # litellm exceptions inherit from openai exceptions + # https://docs.litellm.ai/docs/exception_mapping + # + # openai.BadRequestError, + # litellm.ContextWindowExceededError, + # litellm.ContentPolicyViolationError, + # + # openai.AuthenticationError, + # openai.PermissionDeniedError, + # openai.NotFoundError, + # + openai.APITimeoutError, + openai.UnprocessableEntityError, + openai.RateLimitError, + openai.APIConnectionError, + # openai.APIError, + # openai.APIStatusError, + openai.InternalServerError, + ) + + +class LiteLLMExceptions: + # ai From dad335b8b64886d367766be12116e8fe0880b449 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 12:19:45 -0800 Subject: [PATCH 42/53] refactor: remove unused comment from LiteLLMExceptions class --- aider/exceptions.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aider/exceptions.py b/aider/exceptions.py index b615924f3..fe88fc9a9 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -32,4 +32,3 @@ def retry_exceptions(): class LiteLLMExceptions: - # ai From 8bc9ebf2aa689ad11a13f2bd795ba46252c8b1da Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 12:45:27 -0800 Subject: [PATCH 43/53] feat: add LiteLLM exception handling with ExInfo dataclass --- aider/exceptions.py | 62 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) diff --git a/aider/exceptions.py b/aider/exceptions.py index fe88fc9a9..e3346916f 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -1,4 +1,4 @@ - +from dataclasses import dataclass def retry_exceptions(): import httpx @@ -31,4 +31,64 @@ def retry_exceptions(): ) +@dataclass +class ExInfo: + name: str + retry: bool + description: str + +EXCEPTIONS = [ + ExInfo("APIConnectionError", True, None), + ExInfo("APIError", True, None), + ExInfo("APIResponseValidationError", True, None), + ExInfo("AuthenticationError", True, None), + ExInfo("AzureOpenAIError", True, None), + ExInfo("BadRequestError", True, None), + ExInfo("BudgetExceededError", True, None), + ExInfo("ContentPolicyViolationError", True, None), + ExInfo("ContextWindowExceededError", True, None), + ExInfo("InternalServerError", True, None), + ExInfo("InvalidRequestError", True, None), + ExInfo("JSONSchemaValidationError", True, None), + ExInfo("NotFoundError", True, None), + ExInfo("OpenAIError", True, None), + ExInfo("RateLimitError", True, None), + ExInfo("RouterRateLimitError", True, None), + ExInfo("ServiceUnavailableError", True, None), + ExInfo("UnprocessableEntityError", True, None), + ExInfo("UnsupportedParamsError", True, None), +] + + class LiteLLMExceptions: + exceptions = dict() + + def __init__(self): + self._load() + + def _load(self, strict=False): + import litellm + + for var in dir(litellm): + if not var.endswith("Error"): + continue + + ex_info = None + for exi in EXCEPTIONS: + if var == exi.name: + ex_info = exi + break + + if strict and not ex_info: + raise ValueError(f"{var} is in litellm but not in aider's exceptions list") + + ex = getattr(litellm, var) + self.exceptions[ex] = ex_info + + def exceptions_tuple(self): + return tuple(self.exceptions) + + + +litellm_ex = LiteLLMExceptions() +litellm_ex._load(strict=True) From bba9ca3d5ae658c9c41c215a76103dd8a1e02027 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 12:45:29 -0800 Subject: [PATCH 44/53] feat: add get_ex_info method to lookup exception info --- aider/exceptions.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/aider/exceptions.py b/aider/exceptions.py index e3346916f..41a977985 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -88,6 +88,10 @@ class LiteLLMExceptions: def exceptions_tuple(self): return tuple(self.exceptions) + def get_ex_info(self, ex): + """Return the ExInfo for a given exception instance""" + return self.exceptions.get(ex.__class__) + litellm_ex = LiteLLMExceptions() From 8d4175536fc0d69269ea6d38bc6ba8e70e24d542 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 12:45:32 -0800 Subject: [PATCH 45/53] style: fix linting issues and whitespace in exceptions.py --- aider/exceptions.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aider/exceptions.py b/aider/exceptions.py index 41a977985..12d2761ad 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -1,5 +1,6 @@ from dataclasses import dataclass + def retry_exceptions(): import httpx import openai @@ -37,6 +38,7 @@ class ExInfo: retry: bool description: str + EXCEPTIONS = [ ExInfo("APIConnectionError", True, None), ExInfo("APIError", True, None), @@ -93,6 +95,5 @@ class LiteLLMExceptions: return self.exceptions.get(ex.__class__) - litellm_ex = LiteLLMExceptions() litellm_ex._load(strict=True) From 816fd5e65cc8657c219291cc5aadc6c80cca0a5a Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 13:02:04 -0800 Subject: [PATCH 46/53] refactor: Simplify error handling and remove unused retry exceptions code --- aider/coders/base_coder.py | 77 ++++++++++++++------------------------ aider/exceptions.py | 49 +++++------------------- aider/sendchat.py | 66 +++++++++----------------------- 3 files changed, 54 insertions(+), 138 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index d38a70026..2029a2193 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -19,6 +19,7 @@ from json.decoder import JSONDecodeError from pathlib import Path from typing import List +from aider.exceptions import LiteLLMExceptions from aider import __version__, models, prompts, urls, utils from aider.analytics import Analytics from aider.commands import Commands @@ -29,7 +30,7 @@ from aider.llm import litellm from aider.repo import ANY_GIT_ERROR, GitRepo from aider.repomap import RepoMap from aider.run_cmd import run_cmd -from aider.sendchat import RETRY_TIMEOUT, retry_exceptions, send_completion +from aider.sendchat import RETRY_TIMEOUT, send_completion from aider.utils import format_content, format_messages, format_tokens, is_image_file from ..dump import dump # noqa: F401 @@ -789,34 +790,9 @@ class Coder: self.num_reflections += 1 message = self.reflected_message - def check_and_open_urls(self, exc: Exception) -> List[str]: - import openai - + def check_and_open_urls(self, exc, friendly_msg=None): """Check exception for URLs, offer to open in a browser, with user-friendly error msgs.""" text = str(exc) - friendly_msg = None - - if isinstance(exc, (openai.APITimeoutError, openai.APIConnectionError)): - friendly_msg = ( - "There is a problem connecting to the API provider. Please try again later or check" - " your model settings." - ) - elif isinstance(exc, openai.RateLimitError): - friendly_msg = ( - "The API provider's rate limits have been exceeded. Check with your provider or" - " wait awhile and retry." - ) - elif isinstance(exc, openai.InternalServerError): - friendly_msg = ( - "The API provider seems to be down or overloaded. Please try again later." - ) - elif isinstance(exc, openai.BadRequestError): - friendly_msg = "The API provider refused the request as invalid?" - elif isinstance(exc, openai.AuthenticationError): - friendly_msg = ( - "The API provider refused your authentication. Please check that you are using a" - " valid API key." - ) if friendly_msg: self.io.tool_warning(text) @@ -1152,8 +1128,6 @@ class Coder: return chunks def send_message(self, inp): - import openai # for error codes below - self.cur_messages += [ dict(role="user", content=inp), ] @@ -1173,6 +1147,8 @@ class Coder: retry_delay = 0.125 + litellm_ex = LiteLLMExceptions() + self.usage_report = None exhausted = False interrupted = False @@ -1181,30 +1157,37 @@ class Coder: try: yield from self.send(messages, functions=self.functions) break - except retry_exceptions() as err: - # Print the error and its base classes - # for cls in err.__class__.__mro__: dump(cls.__name__) + except litellm_ex.exceptions_tuple() as err: + ex_info = litellm_ex.get_ex_info(err) - retry_delay *= 2 - if retry_delay > RETRY_TIMEOUT: - self.mdstream = None - self.check_and_open_urls(err) + if ex_info.name == "ContextWindowExceededError": + exhausted = True break + + should_retry = ex_info.retry + if should_retry: + retry_delay *= 2 + if retry_delay > RETRY_TIMEOUT: + should_retry = False + + if not should_retry: + self.mdstream = None + self.check_and_open_urls(err, ex_info.description) + break + err_msg = str(err) - self.io.tool_error(err_msg) + if ex_info.description: + self.io.tool_output(err_msg) + self.io.tool_error(ex_info.description) + else: + self.io.tool_error(err_msg) + self.io.tool_output(f"Retrying in {retry_delay:.1f} seconds...") time.sleep(retry_delay) continue except KeyboardInterrupt: interrupted = True break - except litellm.ContextWindowExceededError: - # The input is overflowing the context window! - exhausted = True - break - except litellm.exceptions.BadRequestError as br_err: - self.io.tool_error(f"BadRequestError: {br_err}") - return except FinishReasonLength: # We hit the output limit! if not self.main_model.info.get("supports_assistant_prefill"): @@ -1219,12 +1202,8 @@ class Coder: messages.append( dict(role="assistant", content=self.multi_response_content, prefix=True) ) - except (openai.APIError, openai.APIStatusError) as err: - # for cls in err.__class__.__mro__: dump(cls.__name__) - self.mdstream = None - self.check_and_open_urls(err) - break except Exception as err: + self.mdstream = None lines = traceback.format_exception(type(err), err, err.__traceback__) self.io.tool_warning("".join(lines)) self.io.tool_error(str(err)) diff --git a/aider/exceptions.py b/aider/exceptions.py index 12d2761ad..52558b576 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -1,37 +1,6 @@ from dataclasses import dataclass -def retry_exceptions(): - import httpx - import openai - - return ( - # httpx - httpx.ConnectError, - httpx.RemoteProtocolError, - httpx.ReadTimeout, - # - # litellm exceptions inherit from openai exceptions - # https://docs.litellm.ai/docs/exception_mapping - # - # openai.BadRequestError, - # litellm.ContextWindowExceededError, - # litellm.ContentPolicyViolationError, - # - # openai.AuthenticationError, - # openai.PermissionDeniedError, - # openai.NotFoundError, - # - openai.APITimeoutError, - openai.UnprocessableEntityError, - openai.RateLimitError, - openai.APIConnectionError, - # openai.APIError, - # openai.APIStatusError, - openai.InternalServerError, - ) - - @dataclass class ExInfo: name: str @@ -43,20 +12,20 @@ EXCEPTIONS = [ ExInfo("APIConnectionError", True, None), ExInfo("APIError", True, None), ExInfo("APIResponseValidationError", True, None), - ExInfo("AuthenticationError", True, None), + ExInfo("AuthenticationError", False, "The API provider is not able to authenticate you. Check your API key."), ExInfo("AzureOpenAIError", True, None), - ExInfo("BadRequestError", True, None), + ExInfo("BadRequestError", False, None), ExInfo("BudgetExceededError", True, None), - ExInfo("ContentPolicyViolationError", True, None), - ExInfo("ContextWindowExceededError", True, None), - ExInfo("InternalServerError", True, None), + ExInfo("ContentPolicyViolationError", True, "The API provider has refused the request due to a safety policy about the content."), + ExInfo("ContextWindowExceededError", False, None), # special case handled in base_coder + ExInfo("InternalServerError", True, "The API provider's servers are down or overloaded."), ExInfo("InvalidRequestError", True, None), ExInfo("JSONSchemaValidationError", True, None), - ExInfo("NotFoundError", True, None), + ExInfo("NotFoundError", False, None), ExInfo("OpenAIError", True, None), - ExInfo("RateLimitError", True, None), + ExInfo("RateLimitError", True, "The API provider has rate limited you. Try again later or check your quotas."), ExInfo("RouterRateLimitError", True, None), - ExInfo("ServiceUnavailableError", True, None), + ExInfo("ServiceUnavailableError", True, "The API provider's servers are down or overloaded."), ExInfo("UnprocessableEntityError", True, None), ExInfo("UnsupportedParamsError", True, None), ] @@ -92,7 +61,7 @@ class LiteLLMExceptions: def get_ex_info(self, ex): """Return the ExInfo for a given exception instance""" - return self.exceptions.get(ex.__class__) + return self.exceptions.get(ex.__class__, ExInfo(None, None, None)) litellm_ex = LiteLLMExceptions() diff --git a/aider/sendchat.py b/aider/sendchat.py index e82e0d8fe..8c63ff830 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -5,6 +5,7 @@ import time import backoff from aider.dump import dump # noqa: F401 +from aider.exceptions import LiteLLMExceptions from aider.llm import litellm # from diskcache import Cache @@ -17,52 +18,6 @@ CACHE = None RETRY_TIMEOUT = 60 -def retry_exceptions(): - import httpx - import openai - - return ( - # httpx - httpx.ConnectError, - httpx.RemoteProtocolError, - httpx.ReadTimeout, - # - # litellm exceptions inherit from openai exceptions - # https://docs.litellm.ai/docs/exception_mapping - # - # openai.BadRequestError, - # litellm.ContextWindowExceededError, - # litellm.ContentPolicyViolationError, - # - # openai.AuthenticationError, - # openai.PermissionDeniedError, - # openai.NotFoundError, - # - openai.APITimeoutError, - openai.UnprocessableEntityError, - openai.RateLimitError, - openai.APIConnectionError, - # openai.APIError, - # openai.APIStatusError, - openai.InternalServerError, - ) - - -def lazy_litellm_retry_decorator(func): - def wrapper(*args, **kwargs): - decorated_func = backoff.on_exception( - backoff.expo, - retry_exceptions(), - max_time=RETRY_TIMEOUT, - on_backoff=lambda details: print( - f"{details.get('exception', 'Exception')}\nRetry in {details['wait']:.1f} seconds." - ), - )(func) - return decorated_func(*args, **kwargs) - - return wrapper - - def send_completion( model_name, messages, @@ -104,6 +59,8 @@ def send_completion( def simple_send_with_retries(model_name, messages, extra_params=None): + litellm_ex = LiteLLMExceptions() + retry_delay = 0.125 while True: try: @@ -117,11 +74,22 @@ def simple_send_with_retries(model_name, messages, extra_params=None): _hash, response = send_completion(**kwargs) return response.choices[0].message.content - except retry_exceptions() as err: + except litellm_ex.exceptions_tuple() as err: + ex_info = litellm_ex.get_ex_info(err) + print(str(err)) - retry_delay *= 2 - if retry_delay > RETRY_TIMEOUT: + if ex_info.description: + print(ex_info.description) + + should_retry = ex_info.retry + if should_retry: + retry_delay *= 2 + if retry_delay > RETRY_TIMEOUT: + should_retry = False + + if not should_retry: break + print(f"Retrying in {retry_delay:.1f} seconds...") time.sleep(retry_delay) continue From 4d96728709c0516c69d322aeed637c2923210dc3 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 13:02:07 -0800 Subject: [PATCH 47/53] fix: Remove unused import of 'backoff' in sendchat.py --- aider/sendchat.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aider/sendchat.py b/aider/sendchat.py index 8c63ff830..4e3c8d66f 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -2,7 +2,6 @@ import hashlib import json import time -import backoff from aider.dump import dump # noqa: F401 from aider.exceptions import LiteLLMExceptions From 9e7219c4d64ccd03484530fdab7c4134cb8b970a Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 13:02:10 -0800 Subject: [PATCH 48/53] style: Run linter to clean up code formatting in sendchat.py --- aider/sendchat.py | 1 - 1 file changed, 1 deletion(-) diff --git a/aider/sendchat.py b/aider/sendchat.py index 4e3c8d66f..e4b8bd7bf 100644 --- a/aider/sendchat.py +++ b/aider/sendchat.py @@ -2,7 +2,6 @@ import hashlib import json import time - from aider.dump import dump # noqa: F401 from aider.exceptions import LiteLLMExceptions from aider.llm import litellm From 4941a360cb66478feb1de33dddbd1f07be3f7af6 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 13:02:17 -0800 Subject: [PATCH 49/53] fix: Restore import of LiteLLMExceptions in base_coder.py --- aider/coders/base_coder.py | 2 +- aider/exceptions.py | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 2029a2193..5867f54e6 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -19,10 +19,10 @@ from json.decoder import JSONDecodeError from pathlib import Path from typing import List -from aider.exceptions import LiteLLMExceptions from aider import __version__, models, prompts, urls, utils from aider.analytics import Analytics from aider.commands import Commands +from aider.exceptions import LiteLLMExceptions from aider.history import ChatSummary from aider.io import ConfirmGroup, InputOutput from aider.linter import Linter diff --git a/aider/exceptions.py b/aider/exceptions.py index 52558b576..fb473712a 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -12,18 +12,30 @@ EXCEPTIONS = [ ExInfo("APIConnectionError", True, None), ExInfo("APIError", True, None), ExInfo("APIResponseValidationError", True, None), - ExInfo("AuthenticationError", False, "The API provider is not able to authenticate you. Check your API key."), + ExInfo( + "AuthenticationError", + False, + "The API provider is not able to authenticate you. Check your API key.", + ), ExInfo("AzureOpenAIError", True, None), ExInfo("BadRequestError", False, None), ExInfo("BudgetExceededError", True, None), - ExInfo("ContentPolicyViolationError", True, "The API provider has refused the request due to a safety policy about the content."), - ExInfo("ContextWindowExceededError", False, None), # special case handled in base_coder + ExInfo( + "ContentPolicyViolationError", + True, + "The API provider has refused the request due to a safety policy about the content.", + ), + ExInfo("ContextWindowExceededError", False, None), # special case handled in base_coder ExInfo("InternalServerError", True, "The API provider's servers are down or overloaded."), ExInfo("InvalidRequestError", True, None), ExInfo("JSONSchemaValidationError", True, None), ExInfo("NotFoundError", False, None), ExInfo("OpenAIError", True, None), - ExInfo("RateLimitError", True, "The API provider has rate limited you. Try again later or check your quotas."), + ExInfo( + "RateLimitError", + True, + "The API provider has rate limited you. Try again later or check your quotas.", + ), ExInfo("RouterRateLimitError", True, None), ExInfo("ServiceUnavailableError", True, "The API provider's servers are down or overloaded."), ExInfo("UnprocessableEntityError", True, None), From 8a3c95d8ddc94aea945e104d46a98b94d04653fe Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 13:09:47 -0800 Subject: [PATCH 50/53] feat: Add LiteLLMExceptions loading in test for send chat functionality --- aider/exceptions.py | 4 ---- tests/basic/test_sendchat.py | 26 +++++++------------------- 2 files changed, 7 insertions(+), 23 deletions(-) diff --git a/aider/exceptions.py b/aider/exceptions.py index fb473712a..73a88cc9c 100644 --- a/aider/exceptions.py +++ b/aider/exceptions.py @@ -74,7 +74,3 @@ class LiteLLMExceptions: def get_ex_info(self, ex): """Return the ExInfo for a given exception instance""" return self.exceptions.get(ex.__class__, ExInfo(None, None, None)) - - -litellm_ex = LiteLLMExceptions() -litellm_ex._load(strict=True) diff --git a/tests/basic/test_sendchat.py b/tests/basic/test_sendchat.py index e2395bc14..65516b42f 100644 --- a/tests/basic/test_sendchat.py +++ b/tests/basic/test_sendchat.py @@ -3,8 +3,9 @@ from unittest.mock import MagicMock, patch import httpx +from aider.exceptions import LiteLLMExceptions from aider.llm import litellm -from aider.sendchat import retry_exceptions, simple_send_with_retries +from aider.sendchat import simple_send_with_retries class PrintCalled(Exception): @@ -12,9 +13,9 @@ class PrintCalled(Exception): class TestSendChat(unittest.TestCase): - def test_retry_exceptions(self): - """Test that retry_exceptions() can be called without raising errors""" - retry_exceptions() # Should not raise any exceptions + def test_litellm_exceptions(self): + litellm_ex = LiteLLMExceptions() + litellm_ex._load(strict=True) @patch("litellm.completion") @patch("builtins.print") @@ -24,7 +25,7 @@ class TestSendChat(unittest.TestCase): # Set up the mock to raise mock_completion.side_effect = [ - litellm.exceptions.RateLimitError( + litellm.RateLimitError( "rate limit exceeded", response=mock, llm_provider="llm_provider", @@ -35,17 +36,4 @@ class TestSendChat(unittest.TestCase): # Call the simple_send_with_retries method simple_send_with_retries("model", ["message"]) - assert mock_print.call_count == 2 - - @patch("litellm.completion") - @patch("builtins.print") - def test_simple_send_with_retries_connection_error(self, mock_print, mock_completion): - # Set up the mock to raise - mock_completion.side_effect = [ - httpx.ConnectError("Connection error"), - None, - ] - - # Call the simple_send_with_retries method - simple_send_with_retries("model", ["message"]) - assert mock_print.call_count == 2 + assert mock_print.call_count == 3 From 80e57ca0747eb75bd1c1d4ea94081044ff9bb18b Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 13:09:50 -0800 Subject: [PATCH 51/53] fix: Remove unused import of httpx in test_sendchat.py --- tests/basic/test_sendchat.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/basic/test_sendchat.py b/tests/basic/test_sendchat.py index 65516b42f..a84c7d64d 100644 --- a/tests/basic/test_sendchat.py +++ b/tests/basic/test_sendchat.py @@ -1,7 +1,6 @@ import unittest from unittest.mock import MagicMock, patch -import httpx from aider.exceptions import LiteLLMExceptions from aider.llm import litellm From 20d5a9fd4b7a4798e9bf30a8282965f0143ad4ec Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Thu, 7 Nov 2024 13:09:52 -0800 Subject: [PATCH 52/53] style: Run linter to clean up whitespace in test_sendchat.py --- tests/basic/test_sendchat.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/basic/test_sendchat.py b/tests/basic/test_sendchat.py index a84c7d64d..28397e5c8 100644 --- a/tests/basic/test_sendchat.py +++ b/tests/basic/test_sendchat.py @@ -1,7 +1,6 @@ import unittest from unittest.mock import MagicMock, patch - from aider.exceptions import LiteLLMExceptions from aider.llm import litellm from aider.sendchat import simple_send_with_retries From 79af39bd2c297dbd0411553dde6a73df2a62a4bc Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Thu, 7 Nov 2024 13:22:28 -0800 Subject: [PATCH 53/53] fix: Change tool_output to tool_warning for error message logging --- aider/coders/base_coder.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 5867f54e6..2f42adfd6 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -1177,7 +1177,7 @@ class Coder: err_msg = str(err) if ex_info.description: - self.io.tool_output(err_msg) + self.io.tool_warning(err_msg) self.io.tool_error(ex_info.description) else: self.io.tool_error(err_msg)