Compare commits

...

96 Commits

Author SHA1 Message Date
Paul Gauthier
509c880b68 set version to 0.56.1.dev 2024-09-09 14:46:20 -07:00
Paul Gauthier
6f2b064f53 version bump to 0.56.0 2024-09-09 14:45:11 -07:00
Paul Gauthier
26c2b2e3ed copy 2024-09-09 14:43:35 -07:00
Paul Gauthier
3976d4b8f1 copy 2024-09-09 14:37:18 -07:00
Paul Gauthier
964fe7e2dc fix: handle UnicodeEncodeError in prompt session 2024-09-09 13:56:27 -07:00
Paul Gauthier
eced076602 feat: add IndexError to ANY_GIT_ERROR tuple in repo.py 2024-09-09 13:46:03 -07:00
Paul Gauthier
bd21122e64 refactor: improve error handling for git version check 2024-09-09 13:44:02 -07:00
Paul Gauthier
00f42590c8 feat: add AssertionError to ANY_GIT_ERROR tuple 2024-09-09 13:41:28 -07:00
Paul Gauthier
4e63254704 refactor: Improve error handling in git repository checks 2024-09-09 13:40:56 -07:00
Paul Gauthier
3cd6790d9a fix: handle OSError in git repo operations 2024-09-09 13:37:24 -07:00
Paul Gauthier
d82d21b8c1 refactor: improve error handling for SQLite operations in RepoMap 2024-09-09 13:34:49 -07:00
Paul Gauthier
1a6284cb24 feat: add error handling for parser loading in basic_lint function 2024-09-09 13:28:04 -07:00
Paul Gauthier
abf6a9db2e fix: Handle additional Git-related errors in GitRepo.list_files 2024-09-09 13:26:07 -07:00
Paul Gauthier
73e7d7bd2a fix: handle git errors when listing files in the repository 2024-09-09 12:42:20 -07:00
Paul Gauthier
82f8aa5d6a copy 2024-09-09 10:26:32 -07:00
Paul Gauthier
cee348614e copy 2024-09-08 17:07:25 -07:00
Paul Gauthier
e40a07a8a1 refactor: move import check before API key setup 2024-09-08 09:26:39 -07:00
Paul Gauthier
99dc235a00 Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-08 09:20:20 -07:00
Paul Gauthier
9982f439e4 feat: improve error handling for import loading 2024-09-08 09:18:20 -07:00
Paul Gauthier (aider)
1e9ff842f3 style: format code with linter 2024-09-08 09:11:08 -07:00
Paul Gauthier (aider)
aeea629d17 feat: add verbose output to check_and_load_imports function 2024-09-08 09:11:03 -07:00
Paul Gauthier
b4389f98fb refactor: Synchronize slow imports and improve error handling 2024-09-08 09:11:00 -07:00
Paul Gauthier (aider)
f54b6860db feat: optimize slow imports loading based on version and executable 2024-09-08 09:07:19 -07:00
Paul Gauthier (aider)
ed7a9c6562 refactor: extract thread launch for load_slow_imports into function 2024-09-08 09:05:55 -07:00
paul-gauthier
ab35e473f3 Merge pull request #1423 from fry69/win-lint-fix
fix: handle OSError when executing lint command
2024-09-08 08:58:14 -07:00
fry69
e526d2890c fix: handle OSError when executing lint command 2024-09-08 13:15:31 +02:00
Paul Gauthier
2eae3738ff Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-07 07:27:21 -07:00
paul-gauthier
f98b64dd98 Merge pull request #1409 from fry69/fry69-contributing
Update CONTRIBUTING.md
2024-09-07 07:23:15 -07:00
Paul Gauthier
d2379a6d73 feat: add shell command suggestion toggle and related prompts 2024-09-07 07:21:41 -07:00
fry69
84758c6c8d Update CONTRIBUTING.md
fix link to benchmark data folder
2024-09-07 16:11:00 +02:00
Paul Gauthier
304566a914 added reflection 70b 2024-09-06 13:50:08 -07:00
Paul Gauthier
e9c0c82e03 added reflection 70b 2024-09-06 13:47:14 -07:00
Paul Gauthier
2aef59e624 update name to DeepSeek V2.5 2024-09-06 13:32:15 -07:00
Paul Gauthier
74631eec98 Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-06 12:02:20 -07:00
paul-gauthier
3a36edb8ec Merge pull request #1397 from fry69/prompt-cache
Enable prompt caching for OpenRouter
2024-09-06 06:04:32 -07:00
fry69
795810ffb8 fix: update model configurations 2024-09-06 13:44:42 +02:00
paul-gauthier
2663233b60 Merge pull request #1388 from cheahjs/docs/cleanup-yi-coder
docs: clean up yi-coder model names
2024-09-05 15:20:29 -07:00
Jun Siang Cheah
8d151a3573 docs: clean up yi-coder model names 2024-09-05 23:04:54 +01:00
Paul Gauthier
1c73e7d43a turn off suggest shell commands during benchmarks 2024-09-05 14:35:34 -07:00
Paul Gauthier
8cfdcbd976 refactor: remove redundant get_system_info method and update related test 2024-09-05 13:00:32 -07:00
Paul Gauthier (aider)
45855bd96c feat: add get_system_info method to Coder base class 2024-09-05 12:59:12 -07:00
Paul Gauthier (aider)
b57468a963 test: add test for Spanish chat language option 2024-09-05 12:58:18 -07:00
Paul Gauthier
34099408a5 copy 2024-09-05 12:55:09 -07:00
Paul Gauthier (aider)
781996fe84 feat: pass chat language to Coder.create 2024-09-05 12:52:26 -07:00
Paul Gauthier (aider)
3d73fac84c feat: add chat_language parameter to Coder class 2024-09-05 12:49:11 -07:00
Paul Gauthier (aider)
2bcc9a54a9 feat: add --chat-language argument for specifying chat language 2024-09-05 12:47:53 -07:00
Paul Gauthier
e4cbbb1fa8 remove eslint as default linter 2024-09-05 12:45:12 -07:00
Paul Gauthier
a35c532211 refactor: Move json import to top of file and remove unused import 2024-09-05 12:00:44 -07:00
Paul Gauthier (aider)
c2b8522e9a refactor: remove unused json import at top level 2024-09-05 12:00:28 -07:00
Paul Gauthier (aider)
5123d8c5de feat: add json import to main.py 2024-09-05 12:00:13 -07:00
Paul Gauthier (aider)
9b924237b7 style: add newline after json import in main.py 2024-09-05 11:59:56 -07:00
Paul Gauthier (aider)
c04453d282 feat: print model info as formatted JSON in verbose mode 2024-09-05 11:59:50 -07:00
Paul Gauthier
f02da16353 set max_tokens=8192 for deepseek models 2024-09-05 11:58:20 -07:00
Paul Gauthier
6c739d391b refactor: rename --models flag to --list-models 2024-09-05 11:40:31 -07:00
paul-gauthier
e3cd9a8f9a Merge pull request #1383 from fry69/list-models
Add --list-models alias for --models
2024-09-05 10:12:44 -07:00
Paul Gauthier
76bc0e11b8 add deepseek v2.5 to refac bench 2024-09-05 10:07:46 -07:00
fry69 (aider)
485d5487af feat: add --list-models alias for --models option 2024-09-05 18:27:05 +02:00
fry69
246ce318d2 fix: rename --models to --list-models in website docs 2024-09-05 18:23:55 +02:00
Paul Gauthier
6e3d8d90de Add deepseek v2.5 2024-09-05 07:59:32 -07:00
Paul Gauthier
2d866418da feat: add ignore_mentions attribute to cloned Coder instances 2024-09-04 14:40:21 -07:00
Paul Gauthier
ff15bcdb30 copy 2024-09-04 14:34:40 -07:00
Paul Gauthier
e799ada6f5 Merge remote-tracking branch 'refs/remotes/origin/main' 2024-09-04 14:33:59 -07:00
Paul Gauthier (aider)
7c5cad74ab style: Format code to comply with linter rules 2024-09-04 14:32:38 -07:00
Paul Gauthier (aider)
41e8f4401e fix: make test_get_rel_fname compatible with Windows 2024-09-04 14:32:35 -07:00
paul-gauthier
e271941aa2 Merge pull request #1349 from cheahjs/patch-1
docs: add benchmark results for yi-coder 9b
2024-09-04 14:14:36 -07:00
Paul Gauthier (aider)
6152a82513 fix: handle ValueError in os.path.relpath calls 2024-09-04 14:10:56 -07:00
Paul Gauthier
937a1cd847 fix: correct string handling in ESLint file path check 2024-09-04 14:06:30 -07:00
Paul Gauthier
867d19952c fix: handle spaces in ESLint file path for TypeScript linting 2024-09-04 14:05:44 -07:00
Paul Gauthier
7c5d999032 fix: correct eslint path in node_modules directory 2024-09-04 14:02:56 -07:00
Paul Gauthier
6d23b22e6f refactor: Remove redundant TypeScript linter fallback 2024-09-04 14:02:02 -07:00
Paul Gauthier
168598dad4 test: remove redundant Windows-specific ESLint test 2024-09-04 14:01:25 -07:00
Paul Gauthier (aider)
bd7ff9cca4 style: run linter and fix import order 2024-09-04 14:00:33 -07:00
Paul Gauthier (aider)
51f360ab9f fix: update ESLint command assertion in Windows test 2024-09-04 14:00:30 -07:00
Paul Gauthier
66ae9ae079 test: add debug output for linter languages in TestLinter 2024-09-04 14:00:28 -07:00
Paul Gauthier (aider)
65fd6b444c fix: simplify ESLint Windows test mock 2024-09-04 13:58:46 -07:00
Paul Gauthier (aider)
15abe6b921 style: Format long line in test_get_rel_fname method 2024-09-04 13:57:16 -07:00
Paul Gauthier (aider)
d8027030b0 fix: update ESLint check and test expectations 2024-09-04 13:57:09 -07:00
Paul Gauthier (aider)
edd9b44ad3 refactor: Remove unused import of Path from test_linter.py 2024-09-04 13:56:25 -07:00
Paul Gauthier (aider)
14fc3e3ad1 style: format code with black and isort 2024-09-04 13:55:53 -07:00
Paul Gauthier (aider)
cd551dbf63 test: add basic tests for Linter class 2024-09-04 13:55:49 -07:00
Paul Gauthier
ed349b65b5 test: add basic linter tests 2024-09-04 13:55:48 -07:00
Paul Gauthier (aider)
bb5bca5227 feat: support Windows ESLint executables in linter detection 2024-09-04 13:53:18 -07:00
Paul Gauthier (aider)
e98645698b refactor: make ESLint path detection cross-platform compatible 2024-09-04 13:52:41 -07:00
Paul Gauthier (aider)
376e8617f3 style: format eslint paths and remove trailing whitespace 2024-09-04 13:51:57 -07:00
Paul Gauthier (aider)
a3d585a4b4 feat: add ESLint detection for TypeScript linting 2024-09-04 13:51:53 -07:00
Jun Siang Cheah
5853c7fa92 docs: add benchmark results for yi-coder 9b 2024-09-04 18:34:52 +01:00
Paul Gauthier
18bf3a9f36 fixes #1348 2024-09-04 10:27:18 -07:00
Paul Gauthier
e7253d819e copy 2024-09-04 10:16:11 -07:00
Paul Gauthier
75c27a5dfb feat: enhance GitHub issue reporting functionality 2024-09-04 10:14:25 -07:00
Paul Gauthier (aider)
7598f883f5 style: format long line in report command for better readability 2024-09-04 10:09:13 -07:00
Paul Gauthier (aider)
1b5ef76c18 refactor: update cmd_report to use confirm=False and conditional user report prefix 2024-09-04 10:09:07 -07:00
Paul Gauthier (aider)
70994cfc5b feat: add confirm parameter to report_github_issue function 2024-09-04 10:08:16 -07:00
Paul Gauthier
c5ac621da1 docs: Update description of 'report' command 2024-09-04 10:08:08 -07:00
Paul Gauthier (aider)
5c6d4dbbf1 feat: add /report command to submit GitHub issues 2024-09-04 10:05:43 -07:00
Paul Gauthier
9434f99458 copy 2024-09-04 09:27:12 -07:00
Paul Gauthier
9988a3ff79 updated blame 2024-09-04 09:20:40 -07:00
43 changed files with 622 additions and 127 deletions

View File

@@ -20,7 +20,7 @@ See the
[benchmark README](https://github.com/paul-gauthier/aider/blob/main/benchmark/README.md)
for information on running aider's code editing benchmarks.
Submit results by opening a PR with edits to the
[benchmark results data files](https://github.com/paul-gauthier/aider/blob/main/_data/).
[benchmark results data files](https://github.com/paul-gauthier/aider/blob/main/aider/website/_data/).
## Pull Requests

View File

@@ -1,6 +1,17 @@
# Release history
### main branch
- New `/report` command to open your browser with a pre-populated GitHub Issue.
- New `--chat-language` switch to set the spoken language.
- Now `--[no-]suggest-shell-commands` controls both prompting for and offering to execute shell commands.
- DeepSeek models use 8192 output tokens.
- Check key imports on launch, provide helpful error message if dependencies aren't available.
- Renamed `--models` to `--list-models`.
- Numerous bug fixes for corner case crashes.
- Aider wrote 56% of the code in this release.
### Aider v0.55.0
- Only print the pip command when self updating on Windows, without running it.

View File

@@ -1,6 +1,6 @@
try:
from aider.__version__ import __version__
except Exception:
__version__ = "0.55.1.dev"
__version__ = "0.56.1.dev"
__all__ = [__version__]

View File

@@ -121,6 +121,7 @@ def get_parser(default_config_files, git_root):
##########
group = parser.add_argument_group("Model Settings")
group.add_argument(
"--list-models",
"--models",
metavar="MODEL",
help="List known models which match the (partial) MODEL name",
@@ -490,6 +491,12 @@ def get_parser(default_config_files, git_root):
default="en",
help="Specify the language for voice using ISO 639-1 code (default: auto)",
)
group.add_argument(
"--chat-language",
metavar="CHAT_LANGUAGE",
default=None,
help="Specify the language to use in the chat (default: None, uses system settings)",
)
group.add_argument(
"--version",
action="version",

View File

@@ -93,6 +93,7 @@ class Coder:
num_cache_warming_pings = 0
suggest_shell_commands = True
ignore_mentions = None
chat_language = None
@classmethod
def create(
@@ -159,7 +160,9 @@ class Coder:
raise ValueError(f"Unknown edit format {edit_format}")
def clone(self, **kwargs):
return Coder.create(from_coder=self, **kwargs)
new_coder = Coder.create(from_coder=self, **kwargs)
new_coder.ignore_mentions = self.ignore_mentions
return new_coder
def get_announcements(self):
lines = []
@@ -258,7 +261,9 @@ class Coder:
cache_prompts=False,
num_cache_warming_pings=0,
suggest_shell_commands=True,
chat_language=None,
):
self.chat_language = chat_language
self.commit_before_message = []
self.aider_commit_hashes = set()
self.rejected_urls = set()
@@ -854,6 +859,9 @@ class Coder:
self.cur_messages = []
def get_user_language(self):
if self.chat_language:
return self.chat_language
try:
lang = locale.getlocale()[0]
if lang:
@@ -915,10 +923,21 @@ class Coder:
lazy_prompt = self.gpt_prompts.lazy_prompt if self.main_model.lazy else ""
platform_text = self.get_platform_info()
if self.suggest_shell_commands:
shell_cmd_prompt = self.gpt_prompts.shell_cmd_prompt.format(platform=platform_text)
shell_cmd_reminder = self.gpt_prompts.shell_cmd_reminder.format(platform=platform_text)
else:
shell_cmd_prompt = self.gpt_prompts.no_shell_cmd_prompt.format(platform=platform_text)
shell_cmd_reminder = self.gpt_prompts.no_shell_cmd_reminder.format(
platform=platform_text
)
prompt = prompt.format(
fence=self.fence,
lazy_prompt=lazy_prompt,
platform=platform_text,
shell_cmd_prompt=shell_cmd_prompt,
shell_cmd_reminder=shell_cmd_reminder,
)
return prompt
@@ -1624,7 +1643,10 @@ class Coder:
return cur + new
def get_rel_fname(self, fname):
return os.path.relpath(fname, self.root)
try:
return os.path.relpath(fname, self.root)
except ValueError:
return fname
def get_inchat_relative_files(self):
files = [self.get_rel_fname(fname) for fname in self.abs_fnames]

View File

@@ -43,3 +43,8 @@ If you need to edit any of these files, ask me to *add them to the chat* first.
read_only_files_prefix = """Here are some READ ONLY files, provided for your reference.
Do not edit these files!
"""
shell_cmd_prompt = ""
shell_cmd_reminder = ""
no_shell_cmd_prompt = ""
no_shell_cmd_reminder = ""

View File

@@ -27,7 +27,10 @@ You can keep asking if you then decide you need to edit more files.
All changes to files must use this *SEARCH/REPLACE block* format.
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
{shell_cmd_prompt}
"""
shell_cmd_prompt = """
4. *Concisely* suggest any shell commands the user might want to run in ```bash blocks.
Just suggest shell commands this way, not example code.
@@ -36,7 +39,6 @@ Only suggest at most a few shell commands at a time, not more than 1-3.
Use the appropriate shell based on the user's system info:
{platform}
Examples of when to suggest shell commands:
- If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.
@@ -47,6 +49,10 @@ Examples of when to suggest shell commands:
- Etc.
"""
no_shell_cmd_prompt = """
Keep in mind these details about the user's platform and environment:
{platform}
"""
example_messages = [
dict(
role="user",
@@ -176,7 +182,10 @@ To rename files which have been added to the chat, use shell commands at the end
{lazy_prompt}
ONLY EVER RETURN CODE IN A *SEARCH/REPLACE BLOCK*!
{shell_cmd_reminder}
"""
shell_cmd_reminder = """
Examples of when to suggest shell commands:
- If you changed a self-contained html file, suggest an OS-appropriate command to open a browser to view it to see the updated content.

View File

@@ -1135,6 +1135,20 @@ class Commands:
settings = format_settings(self.parser, self.args)
self.io.tool_output(settings)
def cmd_report(self, args):
"Report a problem by opening a GitHub Issue"
from aider.report import report_github_issue
announcements = "\n".join(self.coder.get_announcements())
issue_text = announcements
if args.strip():
title = args.strip()
else:
title = None
report_github_issue(issue_text, title=title, confirm=False)
def expand_subdir(file_path):
if file_path.is_file():

View File

@@ -345,7 +345,11 @@ class InputOutput:
session = PromptSession(
key_bindings=kb, editing_mode=self.editingmode, **session_kwargs
)
line = session.prompt()
try:
line = session.prompt()
except UnicodeEncodeError as err:
self.io.tool_error(str(err))
return ""
if line and line[0] == "{" and not multiline_input:
multiline_input = True

View File

@@ -35,7 +35,10 @@ class Linter:
def get_rel_fname(self, fname):
if self.root:
return os.path.relpath(fname, self.root)
try:
return os.path.relpath(fname, self.root)
except ValueError:
return fname
else:
return fname
@@ -43,14 +46,18 @@ class Linter:
cmd += " " + rel_fname
cmd = cmd.split()
process = subprocess.Popen(
cmd,
cwd=self.root,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding=self.encoding,
errors="replace",
)
try:
process = subprocess.Popen(
cmd,
cwd=self.root,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
encoding=self.encoding,
errors="replace",
)
except OSError as err:
print(f"Unable to execute lint command: {err}")
return
stdout, _ = process.communicate()
errors = stdout
if process.returncode == 0:
@@ -202,7 +209,12 @@ def basic_lint(fname, code):
if lang == "typescript":
return
parser = get_parser(lang)
try:
parser = get_parser(lang)
except OSError as err:
print(f"Unable to load parser: {err}")
return
tree = parser.parse(bytes(code, "utf-8"))
errors = traverse_tree(tree.root_node)

View File

@@ -1,8 +1,10 @@
import configparser
import json
import os
import re
import sys
import threading
import traceback
from pathlib import Path
import git
@@ -89,7 +91,7 @@ def setup_git(git_root, io):
pass
try:
user_email = config.get_value("user", "email", None)
except configparser.NoSectionError:
except (configparser.NoSectionError, configparser.NoOptionError):
pass
if user_name and user_email:
@@ -300,23 +302,27 @@ def sanity_check_repo(repo, io):
try:
repo.get_tracked_files()
return True
if not repo.git_repo_error:
return True
error_msg = str(repo.git_repo_error)
except ANY_GIT_ERROR as exc:
error_msg = str(exc)
bad_ver = "version in (1, 2)" in error_msg
except AssertionError as exc:
error_msg = str(exc)
bad_ver = True
if "version in (1, 2)" in error_msg:
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.")
io.tool_output("https://github.com/paul-gauthier/aider/issues/211")
return False
io.tool_error("Unable to read git repository, it may be corrupt?")
io.tool_output(error_msg)
if bad_ver:
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.")
io.tool_output("https://github.com/paul-gauthier/aider/issues/211")
return False
io.tool_error("Unable to read git repository, it may be corrupt?")
io.tool_output(error_msg)
return False
def main(argv=None, input=None, output=None, force_git_root=None, return_coder=False):
report_uncaught_exceptions()
@@ -468,8 +474,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
if args.check_update:
check_version(io, verbose=args.verbose)
if args.models:
models.print_matching_models(io, args.models)
if args.list_models:
models.print_matching_models(io, args.list_models)
return 0
if args.git:
@@ -485,6 +491,8 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
cmd_line = scrub_sensitive_info(args, cmd_line)
io.tool_output(cmd_line, log_only=True)
check_and_load_imports(io, verbose=args.verbose)
if args.anthropic_api_key:
os.environ["ANTHROPIC_API_KEY"] = args.anthropic_api_key
@@ -511,8 +519,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
if args.verbose:
io.tool_output("Model info:")
for key, value in main_model.info.items():
io.tool_output(f" {key}: {value}")
io.tool_output(json.dumps(main_model.info, indent=4))
lint_cmds = parse_lint_cmds(args.lint_cmd, io)
if lint_cmds is None:
@@ -593,6 +600,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
map_mul_no_files=args.map_multiplier_no_files,
num_cache_warming_pings=args.cache_keepalive_pings,
suggest_shell_commands=args.suggest_shell_commands,
chat_language=args.chat_language,
)
except ValueError as err:
io.tool_error(str(err))
@@ -685,10 +693,6 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
if args.exit:
return
thread = threading.Thread(target=load_slow_imports)
thread.daemon = True
thread.start()
while True:
try:
coder.run()
@@ -705,19 +709,72 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
coder.show_announcements()
def load_slow_imports():
def check_and_load_imports(io, verbose=False):
installs_file = Path.home() / ".aider" / "installs.json"
key = (__version__, sys.executable)
if verbose:
io.tool_output(
f"Checking imports for version {__version__} and executable {sys.executable}"
)
io.tool_output(f"Installs file: {installs_file}")
try:
if installs_file.exists():
with open(installs_file, "r") as f:
installs = json.load(f)
if verbose:
io.tool_output("Installs file exists and loaded")
else:
installs = {}
if verbose:
io.tool_output("Installs file does not exist, creating new dictionary")
if str(key) not in installs:
if verbose:
io.tool_output(
"First run for this version and executable, loading imports synchronously"
)
try:
load_slow_imports(swallow=False)
except Exception as err:
io.tool_error(str(err))
io.tool_output("Error loading required imports. Did you install aider properly?")
io.tool_output("https://aider.chat/docs/install/install.html")
sys.exit(1)
installs[str(key)] = True
installs_file.parent.mkdir(parents=True, exist_ok=True)
with open(installs_file, "w") as f:
json.dump(installs, f, indent=4)
if verbose:
io.tool_output("Imports loaded and installs file updated")
else:
if verbose:
io.tool_output("Not first run, loading imports in background thread")
thread = threading.Thread(target=load_slow_imports)
thread.daemon = True
thread.start()
except Exception as e:
io.tool_warning(f"Error in checking imports: {e}")
if verbose:
io.tool_output(f"Full exception details: {traceback.format_exc()}")
def load_slow_imports(swallow=True):
# These imports are deferred in various ways to
# improve startup time.
# This func is called in a thread to load them in the background
# while we wait for the user to type their first message.
# This func is called either synchronously or in a thread
# depending on whether it's been run before for this version and executable.
try:
import httpx # noqa: F401
import litellm # noqa: F401
import networkx # noqa: F401
import numpy # noqa: F401
except Exception:
pass
except Exception as e:
if not swallow:
raise e
if __name__ == "__main__":

View File

@@ -18,7 +18,7 @@ from aider.dump import dump # noqa: F401
from aider.llm import litellm
DEFAULT_MODEL_NAME = "gpt-4o"
ANTHROPIC_BETA_HEADER = "max-tokens-3-5-sonnet-2024-07-15,prompt-caching-2024-07-31"
ANTHROPIC_BETA_HEADER = "prompt-caching-2024-07-31"
OPENAI_MODELS = """
gpt-4
@@ -306,10 +306,8 @@ MODEL_SETTINGS = [
examples_as_sys_msg=True,
accepts_images=True,
max_tokens=8192,
extra_headers={
"anthropic-beta": "max-tokens-3-5-sonnet-2024-07-15",
},
reminder="user",
cache_control=True,
),
# Vertex AI Claude models
# Does not yet support 8k token
@@ -320,6 +318,7 @@ MODEL_SETTINGS = [
use_repo_map=True,
examples_as_sys_msg=True,
accepts_images=True,
max_tokens=8192,
reminder="user",
),
ModelSettings(
@@ -386,6 +385,7 @@ MODEL_SETTINGS = [
use_repo_map=True,
examples_as_sys_msg=True,
reminder="sys",
max_tokens=8192,
),
ModelSettings(
"deepseek/deepseek-coder",
@@ -394,6 +394,7 @@ MODEL_SETTINGS = [
examples_as_sys_msg=True,
reminder="sys",
caches_by_default=True,
max_tokens=8192,
),
ModelSettings(
"openrouter/deepseek/deepseek-coder",

View File

@@ -10,7 +10,7 @@ from aider.sendchat import simple_send_with_retries
from .dump import dump # noqa: F401
ANY_GIT_ERROR = (git.exc.ODBError, git.exc.GitError)
ANY_GIT_ERROR = (git.exc.ODBError, git.exc.GitError, OSError, IndexError)
class GitRepo:
@@ -21,6 +21,7 @@ class GitRepo:
aider_ignore_last_check = 0
subtree_only = False
ignore_file_cache = {}
git_repo_error = None
def __init__(
self,
@@ -257,15 +258,26 @@ class GitRepo:
commit = self.repo.head.commit
except ValueError:
commit = None
except ANY_GIT_ERROR as err:
self.git_repo_error = err
self.io.tool_error(f"Unable to list files in git repo: {err}")
self.io.tool_output("Is your git repo corrupted?")
return []
files = set()
if commit:
if commit in self.tree_files:
files = self.tree_files[commit]
else:
for blob in commit.tree.traverse():
if blob.type == "blob": # blob is a file
files.add(blob.path)
try:
for blob in commit.tree.traverse():
if blob.type == "blob": # blob is a file
files.add(blob.path)
except ANY_GIT_ERROR as err:
self.git_repo_error = err
self.io.tool_error(f"Unable to list files in git repo: {err}")
self.io.tool_output("Is your git repo corrupted?")
return []
files = set(self.normalize_path(path) for path in files)
self.tree_files[commit] = set(files)

View File

@@ -27,6 +27,9 @@ 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)
class RepoMap:
CACHE_VERSION = 3
TAGS_CACHE_DIR = f".aider.tags.cache.v{CACHE_VERSION}"
@@ -167,7 +170,7 @@ class RepoMap:
path = Path(self.root) / self.TAGS_CACHE_DIR
try:
self.TAGS_CACHE = Cache(path)
except sqlite3.OperationalError:
except SQLITE_ERRORS:
self.io.tool_warning(f"Unable to use tags cache, delete {path} to resolve.")
self.TAGS_CACHE = dict()
@@ -195,8 +198,12 @@ class RepoMap:
data = list(self.get_tags_raw(fname, rel_fname))
# Update the cache
self.TAGS_CACHE[cache_key] = {"mtime": file_mtime, "data": data}
self.save_tags_cache()
try:
self.TAGS_CACHE[cache_key] = {"mtime": file_mtime, "data": data}
self.save_tags_cache()
except SQLITE_ERRORS:
pass
return data
def get_tags_raw(self, fname, rel_fname):
@@ -316,6 +323,9 @@ class RepoMap:
if not file_ok:
if fname not in self.warned_files:
self.io.tool_warning(f"Repo-map can't include {fname}")
self.io.tool_output(
"Has it been deleted from the file system but not from git?"
)
self.warned_files.add(fname)
continue

View File

@@ -34,13 +34,14 @@ def get_git_info():
return "Git information unavailable"
def report_github_issue(issue_text, title=None):
def report_github_issue(issue_text, title=None, confirm=True):
"""
Compose a URL to open a new GitHub issue with the given text prefilled,
and attempt to launch it in the default web browser.
:param issue_text: The text of the issue to file
:param title: The title of the issue (optional)
:param confirm: Whether to ask for confirmation before opening the browser (default: True)
:return: None
"""
version_info = f"Aider version: {__version__}\n"
@@ -61,16 +62,17 @@ def report_github_issue(issue_text, title=None):
params["title"] = title
issue_url = f"{github_issues}?{urllib.parse.urlencode(params)}"
print(f"\n# {title}\n")
print(issue_text.strip())
print()
print("Please consider reporting this bug to help improve aider!")
prompt = "Open a GitHub Issue pre-filled with the above error in your browser? (Y/n) "
confirmation = input(prompt).strip().lower()
if confirm:
print(f"\n# {title}\n")
print(issue_text.strip())
print()
print("Please consider reporting this bug to help improve aider!")
prompt = "Open a GitHub Issue pre-filled with the above error in your browser? (Y/n) "
confirmation = input(prompt).strip().lower()
yes = not confirmation or confirmation.startswith("y")
if not yes:
return
yes = not confirmation or confirmation.startswith("y")
if not yes:
return
print("Attempting to open the issue URL in your default web browser...")
try:
@@ -79,13 +81,14 @@ def report_github_issue(issue_text, title=None):
except Exception:
pass
print()
print()
print("You can also use this URL to file the GitHub Issue:")
print()
print(issue_url)
print()
print()
if confirm:
print()
print()
print("You can also use this URL to file the GitHub Issue:")
print()
print(issue_url)
print()
print()
def exception_handler(exc_type, exc_value, exc_traceback):

View File

@@ -16,6 +16,17 @@ cog.out(text)
# Release history
### main branch
- New `/report` command to open your browser with a pre-populated GitHub Issue.
- New `--chat-language` switch to set the spoken language.
- Now `--[no-]suggest-shell-commands` controls both prompting for and offering to execute shell commands.
- DeepSeek models use 8192 output tokens.
- Check key imports on launch, provide helpful error message if dependencies aren't available.
- Renamed `--models` to `--list-models`.
- Numerous bug fixes for corner case crashes.
- Aider wrote 56% of the code in this release.
### Aider v0.55.0
- Only print the pip command when self updating on Windows, without running it.

View File

@@ -2380,3 +2380,105 @@
Paul Gauthier (aider): 204
start_tag: v0.53.0
total_lines: 319
- aider_percentage: 52.9
aider_total: 811
end_date: '2024-09-04'
end_tag: v0.55.0
file_counts:
aider/__init__.py:
Paul Gauthier: 4
Paul Gauthier (aider): 2
aider/args.py:
Paul Gauthier (aider): 7
aider/coders/base_coder.py:
Paul Gauthier: 63
Paul Gauthier (aider): 42
aider/coders/editblock_coder.py:
Nikolay Sedelnikov: 8
aider/coders/editblock_func_coder.py:
Antti Kaihola: 2
aider/coders/search_replace.py:
Paul Gauthier: 2
aider/coders/wholefile_coder.py:
Paul Gauthier: 16
aider/commands.py:
Antti Kaihola: 7
Paul Gauthier: 85
Paul Gauthier (aider): 27
aider/format_settings.py:
Paul Gauthier (aider): 26
aider/gui.py:
Paul Gauthier: 4
aider/io.py:
Paul Gauthier: 63
Paul Gauthier (aider): 13
aider/linter.py:
Paul Gauthier: 5
aider/llm.py:
Paul Gauthier: 2
aider/main.py:
Paul Gauthier: 86
Paul Gauthier (aider): 22
aider/models.py:
Paul Gauthier: 24
Paul Gauthier (aider): 2
aider/repo.py:
Paul Gauthier: 85
aider/repomap.py:
Paul Gauthier: 32
Paul Gauthier (aider): 4
aider/report.py:
Paul Gauthier: 77
Paul Gauthier (aider): 120
aider/run_cmd.py:
Paul Gauthier: 17
Paul Gauthier (aider): 24
aider/scrape.py:
Paul Gauthier: 7
Paul Gauthier (aider): 8
aider/special.py:
Paul Gauthier: 5
Paul Gauthier (aider): 197
aider/urls.py:
Paul Gauthier (aider): 1
aider/utils.py:
Paul Gauthier: 31
Paul Gauthier (aider): 29
aider/versioncheck.py:
Paul Gauthier: 32
Paul Gauthier (aider): 6
aider/voice.py:
Paul Gauthier: 7
Paul Gauthier (aider): 9
scripts/versionbump.py:
Paul Gauthier: 9
tests/basic/test_coder.py:
Paul Gauthier: 3
Paul Gauthier (aider): 105
tests/basic/test_editblock.py:
Antti Kaihola: 3
Nikolay Sedelnikov: 37
tests/basic/test_io.py:
Paul Gauthier: 2
Paul Gauthier (aider): 15
tests/basic/test_main.py:
Paul Gauthier: 2
Paul Gauthier (aider): 10
tests/basic/test_models.py:
Paul Gauthier (aider): 4
tests/basic/test_repomap.py:
Paul Gauthier (aider): 42
tests/basic/test_run_cmd.py:
Paul Gauthier (aider): 11
tests/basic/test_special.py:
Paul Gauthier: 2
Paul Gauthier (aider): 74
tests/scrape/test_scrape.py:
Paul Gauthier (aider): 11
grand_total:
Antti Kaihola: 12
Nikolay Sedelnikov: 45
Paul Gauthier: 665
Paul Gauthier (aider): 811
start_tag: v0.54.0
total_lines: 1533

View File

@@ -317,29 +317,6 @@
seconds_per_case: 22.9
total_cost: 2.7494
- dirname: 2024-05-09-18-57-52--deepseek-chat-v2-diff-reverted-and-helpful-assistant2
test_cases: 133
model: DeepSeek Chat V2 (original)
released: 2024-05-06
edit_format: diff
commit_hash: 80a3f6d
pass_rate_1: 44.4
pass_rate_2: 60.9
percent_cases_well_formed: 97.0
error_outputs: 14
num_malformed_responses: 4
user_asks: 2
lazy_comments: 0
syntax_errors: 13
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 3
command: aider --model deepseek/deepseek-chat
date: 2024-05-09
versions: 0.33.1-dev
seconds_per_case: 86.8
total_cost: 0.0941
- dirname: 2024-05-07-20-32-37--qwen1.5-110b-chat-whole
test_cases: 133
model: qwen1.5-110b-chat
@@ -665,7 +642,7 @@
- dirname: 2024-07-19-08-57-13--openrouter-deepseek-chat-v2-0628
test_cases: 133
model: DeepSeek Chat V2 0628
model: DeepSeek Chat V2 0628 (deprecated)
edit_format: diff
commit_hash: 96ff06e-dirty
pass_rate_1: 60.9
@@ -737,7 +714,7 @@
- dirname: 2024-07-24-07-10-58--deepseek-coder2-0724-diff-direct
test_cases: 133
model: DeepSeek Coder V2 0724
model: DeepSeek Coder V2 0724 (deprecated)
edit_format: diff
commit_hash: 89965bf
pass_rate_1: 57.9
@@ -969,4 +946,97 @@
date: 2024-08-30
versions: 0.54.8-dev
seconds_per_case: 38.3
total_cost: 0.0000
- dirname: 2024-09-04-16-08-09--yi-coder-9b-whole
test_cases: 133
model: Yi Coder 9B Chat
edit_format: whole
commit_hash: c4e4967
pass_rate_1: 46.6
pass_rate_2: 54.1
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 9
lazy_comments: 0
syntax_errors: 14
indentation_errors: 2
exhausted_context_windows: 0
test_timeouts: 4
command: aider --model openai/hf:01-ai/Yi-Coder-9B-Chat --openai-api-base https://glhf.chat/api/openai/v1
date: 2024-09-04
versions: 0.54.13.dev
seconds_per_case: 8.3
total_cost: 0.0000
released: 2024-09-04
- dirname: 2024-09-04-16-17-33--yi-coder-9b-chat-q4_0-whole
test_cases: 133
model: yi-coder:9b-chat-q4_0
edit_format: whole
commit_hash: c4e4967
pass_rate_1: 41.4
pass_rate_2: 45.1
percent_cases_well_formed: 100.0
error_outputs: 0
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 48
lazy_comments: 1
syntax_errors: 1
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 0
command: aider --model ollama/yi-coder:9b-chat-q4_0
date: 2024-09-04
versions: 0.54.13.dev
seconds_per_case: 125.3
total_cost: 0.0000
- dirname: 2024-09-05-14-50-11--deepseek-sep5-no-shell
test_cases: 133
model: DeepSeek V2.5
edit_format: diff
commit_hash: 1279c86
pass_rate_1: 54.9
pass_rate_2: 72.2
percent_cases_well_formed: 96.2
error_outputs: 5
num_malformed_responses: 5
num_with_malformed_responses: 5
user_asks: 4
lazy_comments: 0
syntax_errors: 1
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
command: aider --deepseek
date: 2024-09-05
versions: 0.55.1.dev
seconds_per_case: 49.6
total_cost: 0.0998
- dirname: 2024-09-06-19-55-17--reflection-hyperbolic-whole-output2
test_cases: 133
model: Reflection-70B
edit_format: whole
commit_hash: 74631ee-dirty, 2aef59e-dirty
pass_rate_1: 33.1
pass_rate_2: 42.1
percent_cases_well_formed: 100.0
error_outputs: 2
num_malformed_responses: 0
num_with_malformed_responses: 0
user_asks: 10
lazy_comments: 26
syntax_errors: 1
indentation_errors: 3
exhausted_context_windows: 0
test_timeouts: 3
command: (not currently supported)
date: 2024-09-06
versions: 0.55.1.dev
seconds_per_case: 61.6
total_cost: 0.0000

View File

@@ -167,7 +167,7 @@
- dirname: 2024-07-24-07-49-39--refac-deepseek-coder-v2-0724
test_cases: 89
model: DeepSeek Coder V2 0724
model: DeepSeek Coder V2 0724 (deprecated)
edit_format: diff
commit_hash: bb6e597
pass_rate_1: 32.6
@@ -208,4 +208,25 @@
versions: 0.48.1-dev
seconds_per_case: 16.9
total_cost: 4.0873
- dirname: 2024-09-05-15-19-05--refac-deepseek-v2.5-no-shell
test_cases: 89
model: DeepSeek Chat V2.5
edit_format: diff
commit_hash: 1279c86, 1279c86-dirty
pass_rate_1: 31.5
percent_cases_well_formed: 67.4
error_outputs: 90
num_malformed_responses: 88
num_with_malformed_responses: 29
user_asks: 8
lazy_comments: 7
syntax_errors: 0
indentation_errors: 6
exhausted_context_windows: 2
test_timeouts: 0
command: aider --deepseek
date: 2024-09-05
versions: 0.55.1.dev
seconds_per_case: 225.4
total_cost: 1.0338

View File

@@ -0,0 +1,9 @@
To use aider with pipx on replit, you can run these commands in the replit shell:
```
pip install pipx
pipx run aider-chat ...normal aider args...
```
If you install aider with pipx on replit and try and run it as just `aider` it will crash with a missing `libstdc++.so.6` library.

View File

@@ -54,7 +54,7 @@
# Model Settings:
## List known models which match the (partial) MODEL name
#models:
#list-models:
## Specify the api base url
#openai-api-base:
@@ -239,6 +239,9 @@
## Specify the language for voice using ISO 639-1 code (default: auto)
#voice-language: en
## Specify the language to use in the chat (default: None, uses system settings)
#chat-language:
## Show the version number and exit
#version:

View File

@@ -58,7 +58,7 @@
# Model Settings:
## List known models which match the (partial) MODEL name
#AIDER_MODELS=
#AIDER_LIST_MODELS=
## Specify the api base url
#OPENAI_API_BASE=
@@ -243,6 +243,9 @@
## Specify the language for voice using ISO 639-1 code (default: auto)
#AIDER_VOICE_LANGUAGE=en
## Specify the language to use in the chat (default: None, uses system settings)
#AIDER_CHAT_LANGUAGE=
## Check for updates and return status in the exit code
#AIDER_JUST_CHECK_UPDATE=false

View File

@@ -89,3 +89,8 @@ The yaml file should be a a list of dictionary objects for each model, as follow
examples_as_sys_msg: false
```
You can look at the `ModelSettings` class in
[models.py](https://github.com/paul-gauthier/aider/blob/main/aider/models.py)
file for details about all of the model setting that aider supports.
That file also contains the settings for many popular models.

View File

@@ -102,7 +102,7 @@ cog.outl("```")
# Model Settings:
## List known models which match the (partial) MODEL name
#models:
#list-models:
## Specify the api base url
#openai-api-base:
@@ -287,6 +287,9 @@ cog.outl("```")
## Specify the language for voice using ISO 639-1 code (default: auto)
#voice-language: en
## Specify the language to use in the chat (default: None, uses system settings)
#chat-language:
## Show the version number and exit
#version:

View File

@@ -100,7 +100,7 @@ cog.outl("```")
# Model Settings:
## List known models which match the (partial) MODEL name
#AIDER_MODELS=
#AIDER_LIST_MODELS=
## Specify the api base url
#OPENAI_API_BASE=
@@ -285,6 +285,9 @@ cog.outl("```")
## Specify the language for voice using ISO 639-1 code (default: auto)
#AIDER_VOICE_LANGUAGE=en
## Specify the language to use in the chat (default: None, uses system settings)
#AIDER_CHAT_LANGUAGE=
## Check for updates and return status in the exit code
#AIDER_JUST_CHECK_UPDATE=false

View File

@@ -27,10 +27,11 @@ cog.out(get_md_help())
```
usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model]
[--opus] [--sonnet] [--4] [--4o] [--mini] [--4-turbo]
[--35turbo] [--deepseek] [--models] [--openai-api-base]
[--openai-api-type] [--openai-api-version]
[--openai-api-deployment-id] [--openai-organization-id]
[--model-settings-file] [--model-metadata-file]
[--35turbo] [--deepseek] [--list-models]
[--openai-api-base] [--openai-api-type]
[--openai-api-version] [--openai-api-deployment-id]
[--openai-organization-id] [--model-settings-file]
[--model-metadata-file]
[--verify-ssl | --no-verify-ssl] [--edit-format]
[--weak-model]
[--show-model-warnings | --no-show-model-warnings]
@@ -57,7 +58,7 @@ usage: aider [-h] [--openai-api-key] [--anthropic-api-key] [--model]
[--lint] [--lint-cmd] [--auto-lint | --no-auto-lint]
[--test-cmd] [--auto-test | --no-auto-test] [--test]
[--file] [--read] [--vim] [--voice-language]
[--version] [--just-check-update]
[--chat-language] [--version] [--just-check-update]
[--check-update | --no-check-update]
[--install-main-branch] [--upgrade] [--apply] [--yes]
[-v] [--show-repo-map] [--show-prompts] [--exit]
@@ -130,9 +131,12 @@ Environment variable: `AIDER_DEEPSEEK`
## Model Settings:
### `--models MODEL`
### `--list-models MODEL`
List known models which match the (partial) MODEL name
Environment variable: `AIDER_MODELS`
Environment variable: `AIDER_LIST_MODELS`
Aliases:
- `--list-models MODEL`
- `--models MODEL`
### `--openai-api-base OPENAI_API_BASE`
Specify the api base url
@@ -464,6 +468,10 @@ Specify the language for voice using ISO 639-1 code (default: auto)
Default: en
Environment variable: `AIDER_VOICE_LANGUAGE`
### `--chat-language CHAT_LANGUAGE`
Specify the language to use in the chat (default: None, uses system settings)
Environment variable: `AIDER_CHAT_LANGUAGE`
### `--version`
Show the version number and exit

View File

@@ -29,12 +29,5 @@ pipx install aider-chat
## pipx on replit
To use aider with pipx on replit, you can run these commands in the replit shell:
```
pip install pipx
pipx run aider-chat ...normal aider args...
```
If you install aider with pipx on replit and try and run it as just `aider` it will crash with a missing `libstdc++.so.6` library.
{% include replit-pipx.md %}

View File

@@ -321,6 +321,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.')}")
]]]-->
August 30, 2024.
September 06, 2024.
<!--[[[end]]]-->
</p>

View File

@@ -26,7 +26,7 @@ aider
aider --opus
# List models available from Anthropic
aider --models anthropic/
aider --list-models anthropic/
```
{: .tip }

View File

@@ -24,7 +24,7 @@ setx AZURE_API_BASE https://myendpt.openai.azure.com
aider --model azure/<your_deployment_name>
# List models available from Azure
aider --models azure/
aider --list-models azure/
```
Note that aider will also use environment variables

View File

@@ -54,7 +54,7 @@ aider --model bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0
To see some models available via Bedrock, run:
```
aider --models bedrock/
aider --list-models bedrock/
```
Make sure you have access to these models in your AWS account before attempting to use them with Aider.

View File

@@ -21,5 +21,5 @@ setx COHERE_API_KEY <key> # Windows, restart shell after setx
aider --model command-r-plus
# List models available from Cohere
aider --models cohere_chat/
aider --list-models cohere_chat/
```

View File

@@ -20,6 +20,6 @@ setx GEMINI_API_KEY <key> # Windows, restart shell after setx
aider --model gemini/gemini-1.5-pro-latest
# List models available from Gemini
aider --models gemini/
aider --list-models gemini/
```

View File

@@ -21,7 +21,7 @@ setx GROQ_API_KEY <key> # Windows, restart shell after setx
aider --model groq/llama3-70b-8192
# List models available from Groq
aider --models groq/
aider --list-models groq/
```

View File

@@ -29,7 +29,7 @@ aider --4-turbo
aider --35-turbo
# List models available from OpenAI
aider --models openai/
aider --list-models openai/
```
You can use `aider --model <model-name>` to use any other OpenAI model.

View File

@@ -18,7 +18,7 @@ setx OPENROUTER_API_KEY <key> # Windows, restart shell after setx
aider --model openrouter/<provider>/<model>
# List models available from OpenRouter
aider --models openrouter/
aider --list-models openrouter/
```
In particular, many aider users access Sonnet via OpenRouter:

View File

@@ -9,14 +9,14 @@ Aider uses the [litellm](https://docs.litellm.ai/docs/providers) package
to connect to hundreds of other models.
You can use `aider --model <model-name>` to use any supported model.
To explore the list of supported models you can run `aider --models <model-name>`
To explore the list of supported models you can run `aider --list-models <model-name>`
with a partial model name.
If the supplied name is not an exact match for a known model, aider will
return a list of possible matching models.
For example:
```
$ aider --models turbo
$ aider --list-models turbo
Aider v0.29.3-dev
Models which match "turbo":

View File

@@ -0,0 +1,31 @@
---
parent: Troubleshooting
nav_order: 28
---
# Import errors
Aider expects to be installed via `pip` or `pipx`, which will install
all of its required dependencies.
If aider reports `ImportErrors`, this probably means it has been installed
incorrectly.
## Dependency versions
Aider pins its dependencies and is tested to work with those specific versions.
You should be careful about upgrading or downgrading other python libraries that
aider uses.
If you need other versions of packages for your project,
consider
[installing aider using pipx](/docs/install/pipx.html).
## Replit
You can `pip install aider-chat` on replit, or you can install it via
pipx.
{% include replit-pipx.md %}

View File

@@ -34,6 +34,7 @@ cog.out(get_help_md())
| **/models** | Search the list of available models |
| **/quit** | Exit the application |
| **/read-only** | Add files to the chat that are for reference, not to be edited |
| **/report** | Report a problem by opening a GitHub Issue |
| **/reset** | Drop all files and clear the chat history |
| **/run** | Run a shell command and optionally add the output to the chat (alias: !) |
| **/settings** | Print out the current settings |

View File

@@ -8,6 +8,7 @@ description: Intro and tutorial videos made by aider users.
Here are some tutorial videos made by aider users:
- [Aider and Replit on mobile with your voice](https://x.com/itsPaulAi/status/1830987090617831810) -- Paul Couvert
- [Aider is the OG AI Coding King (Mermaid Diagram AI Agent)](https://www.youtube.com/watch?v=ag-KxYS8Vuw) -- IndyDevDan
- [Installing aider in replit and making a Trello clone](https://x.com/itspaulai/status/1828834199597633724) -- Paul Couvert
- [Step-by-Step Development Environment Setup for AI-Assisted Coding](https://www.youtube.com/watch?v=DnBVgfe6ZQM) -- Coding the Future With AI

View File

@@ -567,6 +567,7 @@ def run_test_real(
verbose=verbose,
# auto_lint=False, # disabled for code-in-json experiments
cache_prompts=True,
suggest_shell_commands=False,
)
coder.max_apply_update_errors = max_apply_update_errors

View File

@@ -0,0 +1,52 @@
import unittest
from unittest.mock import MagicMock, patch
from aider.dump import dump # noqa
from aider.linter import Linter
class TestLinter(unittest.TestCase):
def setUp(self):
self.linter = Linter(encoding="utf-8", root="/test/root")
def test_init(self):
self.assertEqual(self.linter.encoding, "utf-8")
self.assertEqual(self.linter.root, "/test/root")
self.assertIn("python", self.linter.languages)
def test_set_linter(self):
self.linter.set_linter("javascript", "eslint")
self.assertEqual(self.linter.languages["javascript"], "eslint")
def test_get_rel_fname(self):
import os
self.assertEqual(self.linter.get_rel_fname("/test/root/file.py"), "file.py")
expected_path = os.path.normpath("../../other/path/file.py")
actual_path = os.path.normpath(self.linter.get_rel_fname("/other/path/file.py"))
self.assertEqual(actual_path, expected_path)
@patch("subprocess.Popen")
def test_run_cmd(self, mock_popen):
mock_process = MagicMock()
mock_process.returncode = 0
mock_process.communicate.return_value = ("", None)
mock_popen.return_value = mock_process
result = self.linter.run_cmd("test_cmd", "test_file.py", "code")
self.assertIsNone(result)
@patch("subprocess.Popen")
def test_run_cmd_with_errors(self, mock_popen):
mock_process = MagicMock()
mock_process.returncode = 1
mock_process.communicate.return_value = ("Error message", None)
mock_popen.return_value = mock_process
result = self.linter.run_cmd("test_cmd", "test_file.py", "code")
self.assertIsNotNone(result)
self.assertIn("Error message", result.text)
if __name__ == "__main__":
unittest.main()

View File

@@ -620,6 +620,17 @@ class TestMain(TestCase):
)
self.assertTrue(coder.suggest_shell_commands)
def test_chat_language_spanish(self):
with GitTemporaryDirectory():
coder = main(
["--chat-language", "Spanish", "--exit", "--yes"],
input=DummyInput(),
output=DummyOutput(),
return_coder=True,
)
system_info = coder.get_platform_info()
self.assertIn("Spanish", system_info)
@patch("git.Repo.init")
def test_main_exit_with_git_command_not_found(self, mock_git_init):
mock_git_init.side_effect = git.exc.GitCommandNotFound("git", "Command 'git' not found")