Compare commits

...

113 Commits

Author SHA1 Message Date
Paul Gauthier
a5cf0b6ef5 set version to 0.75.1.dev 2025-02-24 12:34:55 -08:00
Paul Gauthier
506280d645 version bump to 0.75.0 2025-02-24 12:33:23 -08:00
Paul Gauthier (aider)
2f79b4fde7 test: Update sonnet model name in test_models.py 2025-02-24 12:32:47 -08:00
Paul Gauthier
846f98628d copy 2025-02-24 12:28:11 -08:00
Paul Gauthier
eed9be5a9e added sonnet 37 to leaderboard 2025-02-24 12:16:14 -08:00
Paul Gauthier
27c77afafc copy 2025-02-24 12:13:47 -08:00
Paul Gauthier
c156b2f817 feat: Update Claude Sonnet model to latest version 2025-02-24 12:11:49 -08:00
Paul Gauthier (aider)
96fcc5df6b fix: Resolve Windows path escaping issue in test_editor.py 2025-02-24 12:09:33 -08:00
Paul Gauthier (aider)
3c775fd5de fix: Resolve Windows path handling and editor command test issues 2025-02-24 12:09:26 -08:00
Paul Gauthier
75e9ee6528 added claude 37 2025-02-24 11:53:07 -08:00
Paul Gauthier
ea0ee96398 test: Add error message to editor file extension assertion 2025-02-24 11:45:48 -08:00
Paul Gauthier (aider)
3fd4a2841a fix: Use separate temp file for log in editor test script 2025-02-24 10:39:16 -08:00
Paul Gauthier (aider)
6ecf44c87a refactor: Remove unused shlex import from editor.py 2025-02-24 10:22:04 -08:00
Paul Gauthier
031e8cea6e feat: Add pipe_editor function for system editor interaction 2025-02-24 10:21:59 -08:00
Paul Gauthier (aider)
757fbb0124 refactor: Remove unused pytest import in test_editor.py 2025-02-24 10:21:51 -08:00
Paul Gauthier
d65e3f73df refactor: Simplify editor discovery and command handling logic 2025-02-24 10:21:45 -08:00
Paul Gauthier (aider)
5b13105d58 fix: Update tests to match string return type of discover_editor() 2025-02-24 10:20:46 -08:00
Paul Gauthier (aider)
c8745afb37 fix: Preserve Windows paths in editor command parsing 2025-02-24 10:18:22 -08:00
Paul Gauthier (aider)
85189c0bde fix: Update temporary script logging to use f-string and full sys.argv 2025-02-24 10:11:58 -08:00
Paul Gauthier (aider)
a8635bade2 fix: Improve test_pipe_editor_with_fake_editor reliability by using explicit log file path 2025-02-24 10:11:45 -08:00
Paul Gauthier (aider)
4560572ff2 style: Fix code formatting in test_editor.py 2025-02-24 09:47:24 -08:00
Paul Gauthier (aider)
c7fa57fd14 refactor: Make test_pipe_editor cross-platform using Python script 2025-02-24 09:47:20 -08:00
Paul Gauthier (aider)
54965fdf2e style: Fix linter warnings in test_editor.py 2025-02-24 09:46:33 -08:00
Paul Gauthier (aider)
30361aa685 fix: Remove unused 'result' variable in test_pipe_editor_with_shell_script 2025-02-24 09:46:29 -08:00
Paul Gauthier (aider)
8be93b72c4 style: Format code and organize imports in test_editor.py 2025-02-24 09:46:20 -08:00
Paul Gauthier (aider)
c7e9d645e5 test: Add test for pipe_editor with shell script logging arguments 2025-02-24 09:46:16 -08:00
Paul Gauthier
fe6a3c89f3 copy 2025-02-24 09:44:57 -08:00
Paul Gauthier
686a32cbc0 refactor: Remove debug dump call in pipe_editor function 2025-02-24 09:28:31 -08:00
Paul Gauthier (aider)
55d7397ff5 style: Organize imports and remove unused import 2025-02-24 09:22:40 -08:00
Paul Gauthier (aider)
3714d554df refactor: Update subprocess call to use shell=True with properly quoted command string 2025-02-24 09:22:34 -08:00
Paul Gauthier
0415de853b fix: Remove shell=True and add debug dump in pipe_editor 2025-02-24 09:22:28 -08:00
Paul Gauthier
0ba1e8f904 set version to 0.74.4.dev 2025-02-23 08:54:05 -08:00
Paul Gauthier
58bfcb0953 version bump to 0.74.3 2025-02-23 08:52:31 -08:00
Paul Gauthier
fa281d89d2 copy 2025-02-23 08:52:06 -08:00
Paul Gauthier
908b10dae0 copy 2025-02-23 08:50:49 -08:00
paul-gauthier
ea03f9def0 Merge pull request #3333 from akaihola/editor-test-fix 2025-02-22 05:22:52 -08:00
Antti Kaihola
3510799fca fix: test for get_environment_editor()
The test for `EDITOR` preference failed to clean up any existing value
of `VISUAL` which may be present in the environment pytest is run in.
2025-02-22 10:12:08 +02:00
Paul Gauthier
1f4a63d6db add socksio dep #3048 2025-02-19 14:37:48 -08:00
Paul Gauthier
dd94a444d2 feat: Add OpenRouter O3 Mini High model configuration to metadata and settings 2025-02-19 13:51:51 -08:00
Paul Gauthier
50fafc9ff6 bump deps; downgrade streamlit per #3221 2025-02-19 13:47:21 -08:00
Paul Gauthier
47fc6a689d Revert "fix: Ignore decoding errors when reading text files"
This reverts commit f67ea5d010.
2025-02-19 13:18:17 -08:00
paul-gauthier
86175a1827 Merge pull request #3127 from FeepingCreature/fix/sort-file-tokens
refactor: Sort files by token count in cmd_tokens
2025-02-18 11:50:36 -08:00
FeepingCreature (aider)
6d6e25df4e refactor: Sort files by token count in cmd_tokens 2025-02-18 20:11:50 +01:00
paul-gauthier
5402ed112c Merge pull request #3283 from ffluk3/add-build-gradle-kts
fix: add build.gradle.kts to special.py
2025-02-17 08:07:41 -08:00
Lucas Shadler
235b83d02e fix: add build.gradle.kts to special.py
Now that aider supports Kotlin syntax, this change will allow for indexing of kotlin-based gradle project files
2025-02-17 06:22:43 -08:00
Paul Gauthier
6ffbec969a copy 2025-02-15 12:01:40 -08:00
Paul Gauthier
185ea71646 Merge branch 'main' of github.com:Aider-AI/aider 2025-02-15 12:00:47 -08:00
Paul Gauthier
69fcc3acd7 fix: Change file reading error handling from "ignore" to "replace" 2025-02-15 12:00:39 -08:00
paul-gauthier
da94cf4aab Merge pull request #3252 from devriesd/editor-shell-true
subprocess called with shell true
2025-02-14 09:15:17 -08:00
Daniel de Vries
8799cf95b4 subprocess now called with shell true 2025-02-14 11:47:45 -05:00
Paul Gauthier (aider)
108ce18d51 style: Fix linting issues in io.py file 2025-02-13 12:12:40 -08:00
Paul Gauthier (aider)
f67ea5d010 fix: Ignore decoding errors when reading text files 2025-02-13 12:12:35 -08:00
Paul Gauthier
dd857aeccf fix: Handle file reading with encoding, ignore decoding errors 2025-02-13 12:12:33 -08:00
Paul Gauthier
44b1acd385 feat: Add tree-sitter language pack configuration and version pinning 2025-02-10 14:25:42 -08:00
Paul Gauthier
b2f6018e05 Merge branch 'main' into ts-pack 2025-02-10 13:59:10 -08:00
Paul Gauthier
bca6507f11 bump deps 2025-02-10 11:48:19 -08:00
Paul Gauthier (aider)
30332c2ba5 style: Apply linter formatting to issues.py script 2025-02-10 11:37:35 -08:00
Paul Gauthier (aider)
17919d7503 refactor: Add priority label check to prevent bot actions on priority issues 2025-02-10 11:37:30 -08:00
Paul Gauthier
42237ced80 feat: Add CLI option to install tree-sitter language pack 2025-02-09 17:19:19 -08:00
Paul Gauthier
737021ccdf Merge branch 'main' into ts-pack 2025-02-09 17:13:53 -08:00
Paul Gauthier
22ed9d8d7c set version to 0.74.3.dev 2025-02-09 15:27:49 -08:00
Paul Gauthier
49dcd11813 version bump to 0.74.2 2025-02-09 15:26:05 -08:00
Paul Gauthier
7c30086d78 copy 2025-02-09 15:25:49 -08:00
Paul Gauthier
e2dbfdc537 feat: Add configurable cache keepalive delay and pings option 2025-02-09 15:22:19 -08:00
Paul Gauthier
674eb109c2 copy 2025-02-08 06:49:14 -08:00
Paul Gauthier
927b5bc8cc Merge branch 'main' into ts-pack 2025-02-07 18:10:37 -08:00
Paul Gauthier
f7dd0fc582 refactor: Modify cache warming mechanism with ok_to_warm_cache flag 2025-02-07 16:39:35 -08:00
Paul Gauthier (aider)
35f30bde04 style: Apply linter formatting to base_coder.py 2025-02-07 16:26:09 -08:00
Paul Gauthier (aider)
a682b50fd4 refactor: Improve cache warming thread cleanup in Coder class 2025-02-07 16:26:02 -08:00
Paul Gauthier
3b5024749f fix: Modify cache warming logic with debug dump statements 2025-02-07 16:26:00 -08:00
Paul Gauthier
2a56d892d7 works with both tsl and tsl-pack 2025-02-07 16:18:09 -08:00
Paul Gauthier
e3d5eaf388 reorg scm files 2025-02-07 15:29:28 -08:00
Paul Gauthier (aider)
5d1f50117b refactor: Improve file lookup logic in get_scm_fname 2025-02-07 15:23:50 -08:00
Paul Gauthier
f6a2ec15d7 refactor: Update get_scm_fname to support multiple query subdirectories 2025-02-07 15:23:48 -08:00
Paul Gauthier
64a8d56725 reorg scm files 2025-02-07 15:17:59 -08:00
Paul Gauthier
71caea32e7 cleanup 2025-02-07 15:11:21 -08:00
Paul Gauthier
17993ef9ff works 2025-02-07 14:26:59 -08:00
Paul Gauthier
b0aa4ef4c8 wip 2025-02-07 11:34:33 -08:00
Paul Gauthier
5c4aaa27d9 Merge branch 'main' into ts-pack 2025-02-07 11:15:10 -08:00
Paul Gauthier
53586d95d0 updated blame 2025-02-07 11:06:30 -08:00
Paul Gauthier (aider)
3877ab1f00 style: Apply linter formatting to blame.py 2025-02-07 10:57:42 -08:00
Paul Gauthier (aider)
2425322e8d refactor: Improve test file filtering logic in blame script 2025-02-07 10:57:38 -08:00
Paul Gauthier (aider)
3f80a113d1 style: Lint and format blame.py script 2025-02-07 10:56:50 -08:00
Paul Gauthier (aider)
9ad20849d3 feat: Include language test files in blame script 2025-02-07 10:56:46 -08:00
Paul Gauthier
c8c58280d8 refactor: Modify file filtering logic in blame script 2025-02-07 10:56:44 -08:00
Paul Gauthier
d40505cd16 copy 2025-02-07 10:55:10 -08:00
Paul Gauthier
25c5f84090 rename 2025-02-07 10:55:01 -08:00
Paul Gauthier (aider)
a58293f04b feat: Add sample Terraform code for HCL language testing 2025-02-07 10:53:28 -08:00
Paul Gauthier
1408fb41b8 feat: Add Terraform HCL fixture file for testing 2025-02-07 10:53:27 -08:00
Paul Gauthier
cb7cb8e527 Add attribution 2025-02-07 10:51:00 -08:00
Paul Gauthier
d750dbc703 bump deps to pickup grep-ast 0.5.0 2025-02-07 10:50:49 -08:00
paul-gauthier
91b417138a Merge pull request #3173 from krewenki/main
Add support for terraform/hcl repomaps
2025-02-07 10:49:02 -08:00
Warren Krewenki
db5eabd927 Add hcl queries and bump required grep-ast 2025-02-07 14:42:19 -04:00
Paul Gauthier
cbcc0fde04 copy 2025-02-07 08:56:02 -08:00
Paul Gauthier
cca3b98a09 set version to 0.74.2.dev 2025-02-07 08:55:43 -08:00
Paul Gauthier
e63b8ff35d version bump to 0.74.1 2025-02-07 08:54:04 -08:00
Paul Gauthier
b6a37bf0e2 copy 2025-02-07 08:51:29 -08:00
Paul Gauthier
249ca4fd75 remove useless tests 2025-02-07 08:51:20 -08:00
Paul Gauthier (aider)
d382869b98 style: Apply linter formatting to test_coder.py 2025-02-07 08:47:39 -08:00
Paul Gauthier (aider)
41a3c27aba feat: Update system prompt prefix tests to check first line 2025-02-07 08:47:33 -08:00
Paul Gauthier (aider)
af48c46c30 style: Fix linting issues in test_coder.py 2025-02-07 08:39:39 -08:00
Paul Gauthier (aider)
52bc51a197 test: Add tests for system_prompt_prefix functionality 2025-02-07 08:39:33 -08:00
Paul Gauthier (aider)
57ca9cc840 feat: Add continuation prompt for multiline input in prompt_toolkit 2025-02-07 08:36:52 -08:00
Paul Gauthier
56d6a47ad3 remove ". " from multiline input 2025-02-07 08:34:16 -08:00
Paul Gauthier
b806360a49 copy 2025-02-06 16:47:41 -08:00
Paul Gauthier
739a88ed00 Add -DEXERCISM_RUN_ALL_TESTS to cpp tests 2025-02-06 16:41:59 -08:00
Paul Gauthier (aider)
38d4341e59 build: Add libboost-all-dev to Dockerfile for C++ support 2025-02-06 16:41:45 -08:00
Paul Gauthier
6118d91922 improve unit tests in benchmark 2025-02-06 16:27:29 -08:00
Paul Gauthier
71ac7efafe copy 2025-02-06 15:35:10 -08:00
Paul Gauthier
cf0710225c Tell o1 & o3-mini to use markdown 2025-02-06 15:32:21 -08:00
Paul Gauthier
21e96df85a copy 2025-02-06 14:56:58 -08:00
Paul Gauthier
ee837889db Merge branch 'main' into ts-pack 2024-11-27 08:54:03 -08:00
Paul Gauthier
a5f4cba72f wip 2024-11-27 08:53:41 -08:00
74 changed files with 1710 additions and 1012 deletions

View File

@@ -1,9 +1,34 @@
# Release history
### Aider v0.75.0
- Basic support for Claude 3.7 Sonnet
- Use `--model sonnet` to use the new 3.7
- Thinking support coming soon.
- Bugfix to `/editor` command.
### Aider v0.74.3
- Downgrade streamlit dependency to avoid threading bug.
- Added support for tree-sitter language pack.
- Added openrouter/o3-mini-high model configuration.
- Added build.gradle.kts to special files for Kotlin project support, by Lucas Shadler.
### Aider v0.74.2
- Prevent more than one cache warming thread from becoming active.
- Fixed continuation prompt ". " for multiline input.
- Added HCL (Terraform) syntax support, by Warren Krewenki.
### Aider v0.74.1
- Have o1 & o3-mini generate markdown by sending the magic "Formatting re-enabled." string.
- Bugfix for multi-line inputs, which should not include the ". " continuation prompt.
### Aider v0.74.0
- Dynamically changes the Ollama context window to hold the current chat.
- Better support for o3-mini, DeepSeek V3 & R1, o1-mini, o1 via secondary API providers.
- Better support for o3-mini, DeepSeek V3 & R1, o1-mini, o1 especially via third-party API providers.
- Remove `<think>` tags from R1 responses for commit messages (and other weak model uses).
- Can now specify `use_temperature: <float>` in model settings, not just true/false.
- The full docker container now includes `boto3` for Bedrock.

View File

@@ -6,8 +6,7 @@
Aider lets you pair program with LLMs,
to edit code in your local git repository.
Start a new project or work with an existing code base.
Aider works best with Claude 3.5 Sonnet, DeepSeek V3, o1 & GPT-4o and can [connect to almost any LLM](https://aider.chat/docs/llms.html).
Aider works best with Claude 3.5 Sonnet, DeepSeek R1 & Chat V3, OpenAI o1, o3-mini & GPT-4o. Aider can [connect to almost any LLM, including local models](https://aider.chat/docs/llms.html).
<!-- SCREENCAST START -->
<p align="center">

View File

@@ -1,6 +1,6 @@
from packaging import version
__version__ = "0.74.1.dev"
__version__ = "0.75.1.dev"
safe_version = __version__
try:

View File

@@ -46,7 +46,7 @@ def get_parser(default_config_files, git_root):
const=opus_model,
help=f"Use {opus_model} model for the main chat",
)
sonnet_model = "claude-3-5-sonnet-20241022"
sonnet_model = "anthropic/claude-3-7-sonnet-20250219"
group.add_argument(
"--sonnet",
action="store_const",
@@ -823,6 +823,12 @@ def get_parser(default_config_files, git_root):
"--editor",
help="Specify which editor to use for the /editor command",
)
group.add_argument(
"--install-tree-sitter-language-pack",
action="store_true",
help="Install the tree_sitter_language_pack (experimental)",
default=False,
)
return parser

View File

@@ -168,6 +168,7 @@ class Coder:
use_kwargs.update(kwargs) # override passed kwargs
kwargs = use_kwargs
from_coder.ok_to_warm_cache = False
for coder in coders.__all__:
if hasattr(coder, "edit_format") and coder.edit_format == edit_format:
@@ -264,6 +265,8 @@ class Coder:
return lines
ok_to_warm_cache = False
def __init__(
self,
main_model,
@@ -1077,6 +1080,10 @@ class Coder:
shell_cmd_reminder=shell_cmd_reminder,
language=language,
)
if self.main_model.system_prompt_prefix:
prompt = self.main_model.system_prompt_prefix + prompt
return prompt
def format_chat_chunks(self):
@@ -1196,8 +1203,11 @@ class Coder:
return
if not self.num_cache_warming_pings:
return
if not self.ok_to_warm_cache:
return
delay = 5 * 60 - 5
delay = float(os.environ.get("AIDER_CACHE_KEEPALIVE_DELAY", delay))
self.next_cache_warm = time.time() + delay
self.warming_pings_left = self.num_cache_warming_pings
self.cache_warming_chunks = chunks
@@ -1206,7 +1216,7 @@ class Coder:
return
def warm_cache_worker():
while True:
while self.ok_to_warm_cache:
time.sleep(1)
if self.warming_pings_left <= 0:
continue
@@ -1531,6 +1541,10 @@ class Coder:
return res
def __del__(self):
"""Cleanup when the Coder object is destroyed."""
self.ok_to_warm_cache = False
def add_assistant_reply_to_cur_messages(self):
if self.partial_response_content:
self.cur_messages += [dict(role="assistant", content=self.partial_response_content)]

View File

@@ -404,6 +404,7 @@ class Commands:
fence = "`" * 3
file_res = []
# files
for fname in self.coder.abs_fnames:
relative_fname = self.coder.get_rel_fname(fname)
@@ -414,7 +415,7 @@ class Commands:
# approximate
content = f"{relative_fname}\n{fence}\n" + content + "{fence}\n"
tokens = self.coder.main_model.token_count(content)
res.append((tokens, f"{relative_fname}", "/drop to remove"))
file_res.append((tokens, f"{relative_fname}", "/drop to remove"))
# read-only files
for fname in self.coder.abs_read_only_fnames:
@@ -424,7 +425,10 @@ class Commands:
# approximate
content = f"{relative_fname}\n{fence}\n" + content + "{fence}\n"
tokens = self.coder.main_model.token_count(content)
res.append((tokens, f"{relative_fname} (read-only)", "/drop to remove"))
file_res.append((tokens, f"{relative_fname} (read-only)", "/drop to remove"))
file_res.sort()
res.extend(file_res)
self.io.tool_output(
f"Approximate context window usage for {self.coder.main_model.name}, in tokens:"

View File

@@ -10,12 +10,13 @@ This module provides functionality to:
import os
import platform
import shlex
import subprocess
import tempfile
from rich.console import Console
from aider.dump import dump # noqa
DEFAULT_EDITOR_NIX = "vi"
DEFAULT_EDITOR_OS_X = "vim"
DEFAULT_EDITOR_WINDOWS = "notepad"
@@ -87,13 +88,13 @@ def get_environment_editor(default=None):
def discover_editor(editor_override=None):
"""
Discovers and returns the appropriate editor command as a list of arguments.
Discovers and returns the appropriate editor command.
Handles cases where the editor command includes arguments, including quoted arguments
with spaces (e.g. 'vim -c "set noswapfile"').
:return: A list of command parts ready for subprocess execution
:rtype: list[str]
:return: The editor command as a string
:rtype: str
"""
system = platform.system()
if system == "Windows":
@@ -102,14 +103,13 @@ def discover_editor(editor_override=None):
default_editor = DEFAULT_EDITOR_OS_X
else:
default_editor = DEFAULT_EDITOR_NIX
if editor_override:
editor = editor_override
else:
editor = get_environment_editor(default_editor)
try:
return shlex.split(editor)
except ValueError as e:
raise RuntimeError(f"Invalid editor command format '{editor}': {e}")
return editor
def pipe_editor(input_data="", suffix=None, editor=None):
@@ -128,9 +128,10 @@ def pipe_editor(input_data="", suffix=None, editor=None):
:rtype: str
"""
filepath = write_temp_file(input_data, suffix)
command_parts = discover_editor(editor)
command_parts.append(filepath)
subprocess.call(command_parts)
command_str = discover_editor(editor)
command_str += " " + filepath
subprocess.call(command_str, shell=True)
with open(filepath, "r") as f:
output_data = f.read()
try:

View File

@@ -504,7 +504,7 @@ class InputOutput:
"Handle Enter key press"
if self.multiline_mode:
# In multiline mode, Enter adds a newline
event.current_buffer.insert_text("\n. ")
event.current_buffer.insert_text("\n")
else:
# In normal mode, Enter submits
event.current_buffer.validate_and_handle()
@@ -517,7 +517,7 @@ class InputOutput:
event.current_buffer.validate_and_handle()
else:
# In normal mode, Alt+Enter adds a newline
event.current_buffer.insert_text("\n. ")
event.current_buffer.insert_text("\n")
while True:
if multiline_input:
@@ -536,6 +536,9 @@ class InputOutput:
if self.clipboard_watcher:
self.clipboard_watcher.start()
def get_continuation(width, line_number, is_soft_wrap):
return ". "
line = self.prompt_session.prompt(
show,
default=default,
@@ -545,6 +548,7 @@ class InputOutput:
style=style,
key_bindings=kb,
complete_while_typing=True,
prompt_continuation=get_continuation,
)
else:
line = input(show)

View File

@@ -8,7 +8,7 @@ from dataclasses import dataclass
from pathlib import Path
from grep_ast import TreeContext, filename_to_lang
from tree_sitter_languages import get_parser # noqa: E402
from grep_ast.tsl import get_parser # noqa: E402
from aider.dump import dump # noqa: F401
from aider.run_cmd import run_cmd_subprocess # noqa: F401

View File

@@ -214,6 +214,18 @@ def check_streamlit_install(io):
)
def install_tree_sitter_language_pack(io):
return utils.check_pip_install_extra(
io,
"tree_sitter_language_pack",
"Install tree_sitter_language_pack?",
[
"tree-sitter-language-pack==0.4.0",
"tree-sitter==0.24.0",
],
)
def write_streamlit_credentials():
from streamlit.file_util import get_streamlit_file_path
@@ -706,6 +718,11 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
analytics.event("exit", reason="Upgrade completed")
return 0 if success else 1
if args.install_tree_sitter_language_pack:
success = install_tree_sitter_language_pack(io)
analytics.event("exit", reason="Install TSLP completed")
return 0 if success else 1
if args.check_update:
check_version(io, verbose=args.verbose)
@@ -1060,10 +1077,13 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F
while True:
try:
coder.ok_to_warm_cache = bool(args.cache_keepalive_pings)
coder.run()
analytics.event("exit", reason="Completed main CLI coder.run")
return
except SwitchCoder as switch:
coder.ok_to_warm_cache = False
kwargs = dict(io=io, from_coder=coder)
kwargs.update(switch.kwargs)
if "show_announcements" in kwargs:

View File

@@ -76,7 +76,7 @@ ANTHROPIC_MODELS = [ln.strip() for ln in ANTHROPIC_MODELS.splitlines() if ln.str
# Mapping of model aliases to their canonical names
MODEL_ALIASES = {
# Claude models
"sonnet": "claude-3-5-sonnet-20241022",
"sonnet": "anthropic/claude-3-7-sonnet-20250219",
"haiku": "claude-3-5-haiku-20241022",
"opus": "claude-3-opus-20240229",
# GPT models
@@ -114,6 +114,7 @@ class ModelSettings:
editor_model_name: Optional[str] = None
editor_edit_format: Optional[str] = None
remove_reasoning: Optional[str] = None
system_prompt_prefix: Optional[str] = None
# Load model settings from package resource
@@ -294,6 +295,7 @@ class Model(ModelSettings):
self.edit_format = "diff"
self.use_repo_map = True
self.use_temperature = False
self.system_prompt_prefix = "Formatting re-enabled. "
return # <--
if "/o1-mini" in model:
@@ -314,6 +316,7 @@ class Model(ModelSettings):
self.use_repo_map = True
self.use_temperature = False
self.streaming = False
self.system_prompt_prefix = "Formatting re-enabled. "
return # <--
if "deepseek" in model and "v3" in model:

View File

@@ -0,0 +1,88 @@
(
(comment)* @doc
.
(method_definition
name: (property_identifier) @name.definition.method) @definition.method
(#not-eq? @name.definition.method "constructor")
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
(#select-adjacent! @doc @definition.method)
)
(
(comment)* @doc
.
[
(class
name: (_) @name.definition.class)
(class_declaration
name: (_) @name.definition.class)
] @definition.class
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
(#select-adjacent! @doc @definition.class)
)
(
(comment)* @doc
.
[
(function_expression
name: (identifier) @name.definition.function)
(function_declaration
name: (identifier) @name.definition.function)
(generator_function
name: (identifier) @name.definition.function)
(generator_function_declaration
name: (identifier) @name.definition.function)
] @definition.function
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
(#select-adjacent! @doc @definition.function)
)
(
(comment)* @doc
.
(lexical_declaration
(variable_declarator
name: (identifier) @name.definition.function
value: [(arrow_function) (function_expression)]) @definition.function)
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
(#select-adjacent! @doc @definition.function)
)
(
(comment)* @doc
.
(variable_declaration
(variable_declarator
name: (identifier) @name.definition.function
value: [(arrow_function) (function_expression)]) @definition.function)
(#strip! @doc "^[\\s\\*/]+|^[\\s\\*/]$")
(#select-adjacent! @doc @definition.function)
)
(assignment_expression
left: [
(identifier) @name.definition.function
(member_expression
property: (property_identifier) @name.definition.function)
]
right: [(arrow_function) (function_expression)]
) @definition.function
(pair
key: (property_identifier) @name.definition.function
value: [(arrow_function) (function_expression)]) @definition.function
(
(call_expression
function: (identifier) @name.reference.call) @reference.call
(#not-match? @name.reference.call "^(require)$")
)
(call_expression
function: (member_expression
property: (property_identifier) @name.reference.call)
arguments: (_) @reference.call)
(new_expression
constructor: (_) @name.reference.class) @reference.class

View File

@@ -0,0 +1,77 @@
;; Based on https://github.com/tree-sitter-grammars/tree-sitter-hcl/blob/main/make_grammar.js
;; Which has Apache 2.0 License
;; tags.scm for Terraform (tree-sitter-hcl)
; === Definitions: Terraform Blocks ===
(block
(identifier) @block_type
(string_lit (template_literal) @resource_type)
(string_lit (template_literal) @name.definition.resource)
(body) @definition.resource
) (#eq? @block_type "resource")
(block
(identifier) @block_type
(string_lit (template_literal) @name.definition.module)
(body) @definition.module
) (#eq? @block_type "module")
(block
(identifier) @block_type
(string_lit (template_literal) @name.definition.variable)
(body) @definition.variable
) (#eq? @block_type "variable")
(block
(identifier) @block_type
(string_lit (template_literal) @name.definition.output)
(body) @definition.output
) (#eq? @block_type "output")
(block
(identifier) @block_type
(string_lit (template_literal) @name.definition.provider)
(body) @definition.provider
) (#eq? @block_type "provider")
(block
(identifier) @block_type
(body
(attribute
(identifier) @name.definition.local
(expression) @definition.local
)+
)
) (#eq? @block_type "locals")
; === References: Variables, Locals, Modules, Data, Resources ===
((variable_expr) @ref_type
(get_attr (identifier) @name.reference.variable)
) @reference.variable
(#eq? @ref_type "var")
((variable_expr) @ref_type
(get_attr (identifier) @name.reference.local)
) @reference.local
(#eq? @ref_type "local")
((variable_expr) @ref_type
(get_attr (identifier) @name.reference.module)
) @reference.module
(#eq? @ref_type "module")
((variable_expr) @ref_type
(get_attr (identifier) @data_source_type)
(get_attr (identifier) @name.reference.data)
) @reference.data
(#eq? @ref_type "data")
((variable_expr) @resource_type
(get_attr (identifier) @name.reference.resource)
) @reference.resource
(#not-eq? @resource_type "var")
(#not-eq? @resource_type "local")
(#not-eq? @resource_type "module")
(#not-eq? @resource_type "data")
(#not-eq? @resource_type "provider")
(#not-eq? @resource_type "output")

View File

@@ -23,7 +23,7 @@ from aider.utils import Spinner
# tree_sitter is throwing a FutureWarning
warnings.simplefilter("ignore", category=FutureWarning)
from tree_sitter_languages import get_language, get_parser # noqa: E402
from grep_ast.tsl import USING_TSL_PACK, get_language, get_parser # noqa: E402
Tag = namedtuple("Tag", "rel_fname fname line name kind".split())
@@ -31,8 +31,12 @@ Tag = namedtuple("Tag", "rel_fname fname line name kind".split())
SQLITE_ERRORS = (sqlite3.OperationalError, sqlite3.DatabaseError, OSError)
CACHE_VERSION = 3
if USING_TSL_PACK:
CACHE_VERSION = 4
class RepoMap:
CACHE_VERSION = 3
TAGS_CACHE_DIR = f".aider.tags.cache.v{CACHE_VERSION}"
warned_files = set()
@@ -282,10 +286,15 @@ class RepoMap:
query = language.query(query_scm)
captures = query.captures(tree.root_node)
captures = list(captures)
saw = set()
for node, tag in captures:
if USING_TSL_PACK:
all_nodes = []
for tag, nodes in captures.items():
all_nodes += [(node, tag) for node in nodes]
else:
all_nodes = list(captures)
for node, tag in all_nodes:
if tag.startswith("name.definition."):
kind = "def"
elif tag.startswith("name.reference."):
@@ -732,8 +741,27 @@ def get_random_color():
def get_scm_fname(lang):
# Load the tags queries
if USING_TSL_PACK:
subdir = "tree-sitter-language-pack"
try:
path = resources.files(__package__).joinpath(
"queries",
subdir,
f"{lang}-tags.scm",
)
if path.exists():
return path
except KeyError:
pass
# Fall back to tree-sitter-languages
subdir = "tree-sitter-languages"
try:
return resources.files(__package__).joinpath("queries", f"tree-sitter-{lang}-tags.scm")
return resources.files(__package__).joinpath(
"queries",
subdir,
f"{lang}-tags.scm",
)
except KeyError:
return

View File

@@ -97,6 +97,22 @@
"supports_system_messages": true,
"supports_response_schema": true
},
"openrouter/openai/o3-mini-high": {
"max_tokens": 100000,
"max_input_tokens": 200000,
"max_output_tokens": 100000,
"input_cost_per_token": 0.0000011,
"output_cost_per_token": 0.0000044,
"cache_read_input_token_cost": 0.00000055,
"litellm_provider": "openrouter",
"mode": "chat",
"supports_function_calling": true,
"supports_parallel_function_calling": true,
"supports_vision": true,
"supports_prompt_caching": true,
"supports_system_messages": true,
"supports_response_schema": true
},
"openrouter/openai/gpt-4o-mini": {
"max_tokens": 16384,
"max_input_tokens": 128000,
@@ -115,4 +131,44 @@
"supports_prompt_caching": true,
"supports_system_messages": true
},
"claude-3-7-sonnet-20250219": {
"max_tokens": 8192,
"max_input_tokens": 200000,
"max_output_tokens": 8192,
"input_cost_per_token": 0.000003,
"output_cost_per_token": 0.000015,
"cache_creation_input_token_cost": 0.00000375,
"cache_read_input_token_cost": 0.0000003,
"litellm_provider": "anthropic",
"mode": "chat",
"supports_function_calling": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 159,
"supports_assistant_prefill": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_response_schema": true,
"deprecation_date": "2025-10-01",
"supports_tool_choice": true
},
"anthropic/claude-3-7-sonnet-20250219": {
"max_tokens": 8192,
"max_input_tokens": 200000,
"max_output_tokens": 8192,
"input_cost_per_token": 0.000003,
"output_cost_per_token": 0.000015,
"cache_creation_input_token_cost": 0.00000375,
"cache_read_input_token_cost": 0.0000003,
"litellm_provider": "anthropic",
"mode": "chat",
"supports_function_calling": true,
"supports_vision": true,
"tool_use_system_prompt_tokens": 159,
"supports_assistant_prefill": true,
"supports_pdf_input": true,
"supports_prompt_caching": true,
"supports_response_schema": true,
"deprecation_date": "2025-10-01",
"supports_tool_choice": true
},
}

View File

@@ -184,6 +184,19 @@
editor_model_name: anthropic/claude-3-5-sonnet-20241022
editor_edit_format: editor-diff
- name: anthropic/claude-3-7-sonnet-20250219
edit_format: diff
weak_model_name: anthropic/claude-3-5-haiku-20241022
use_repo_map: true
examples_as_sys_msg: true
extra_params:
extra_headers:
anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25
max_tokens: 8192
cache_control: true
editor_model_name: anthropic/claude-3-7-sonnet-20250219
editor_edit_format: editor-diff
- name: bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0
edit_format: diff
weak_model_name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0
@@ -569,6 +582,7 @@
streaming: false
editor_model_name: openrouter/openai/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: "Formatting re-enabled. "
- name: openai/o1
edit_format: diff
@@ -578,6 +592,7 @@
streaming: false
editor_model_name: openai/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: "Formatting re-enabled. "
- name: o1
edit_format: diff
@@ -587,6 +602,7 @@
streaming: false
editor_model_name: gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: "Formatting re-enabled. "
- name: openrouter/qwen/qwen-2.5-coder-32b-instruct
edit_format: diff
@@ -634,6 +650,7 @@
use_temperature: false
editor_model_name: gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: "Formatting re-enabled. "
- name: o3-mini
edit_format: diff
@@ -642,6 +659,7 @@
use_temperature: false
editor_model_name: gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: "Formatting re-enabled. "
- name: openrouter/openai/o3-mini
edit_format: diff
@@ -650,6 +668,16 @@
use_temperature: false
editor_model_name: openrouter/openai/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: "Formatting re-enabled. "
- name: openrouter/openai/o3-mini-high
edit_format: diff
weak_model_name: openrouter/openai/gpt-4o-mini
use_repo_map: true
use_temperature: false
editor_model_name: openrouter/openai/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: "Formatting re-enabled. "
- name: azure/o3-mini
edit_format: diff
@@ -658,5 +686,6 @@
use_temperature: false
editor_model_name: azure/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: "Formatting re-enabled. "

View File

@@ -41,6 +41,7 @@ ROOT_IMPORTANT_FILES = [
"composer.lock",
"pom.xml",
"build.gradle",
"build.gradle.kts",
"build.sbt",
"go.mod",
"go.sum",

View File

@@ -23,10 +23,35 @@ cog.out(text)
]]]-->
### Aider v0.75.0
- Basic support for Claude 3.7 Sonnet
- Use `--model sonnet` to use the new 3.7
- Thinking support coming soon.
- Bugfix to `/editor` command.
### Aider v0.74.3
- Downgrade streamlit dependency to avoid threading bug.
- Added support for tree-sitter language pack.
- Added openrouter/o3-mini-high model configuration.
- Added build.gradle.kts to special files for Kotlin project support, by Lucas Shadler.
### Aider v0.74.2
- Prevent more than one cache warming thread from becoming active.
- Fixed continuation prompt ". " for multiline input.
- Added HCL (Terraform) syntax support, by Warren Krewenki.
### Aider v0.74.1
- Have o1 & o3-mini generate markdown by sending the magic "Formatting re-enabled." string.
- Bugfix for multi-line inputs, which should not include the ". " continuation prompt.
### Aider v0.74.0
- Dynamically changes the Ollama context window to hold the current chat.
- Better support for o3-mini, DeepSeek V3 & R1, o1-mini, o1 via secondary API providers.
- Better support for o3-mini, DeepSeek V3 & R1, o1-mini, o1 especially via third-party API providers.
- Remove `<think>` tags from R1 responses for commit messages (and other weak model uses).
- Can now specify `use_temperature: <float>` in model settings, not just true/false.
- The full docker container now includes `boto3` for Bedrock.

View File

@@ -3167,8 +3167,8 @@
malkoG: 83
start_tag: v0.64.0
total_lines: 670
- aider_percentage: 81.65
aider_total: 574
- aider_percentage: 86.17
aider_total: 841
end_date: '2024-12-01'
end_tag: v0.66.0
file_counts:
@@ -3240,18 +3240,52 @@
Paul Gauthier (aider): 103
tests/browser/test_browser.py:
Paul Gauthier: 1
tests/fixtures/languages/c/test.c:
Paul Gauthier (aider): 6
tests/fixtures/languages/cpp/test.cpp:
Paul Gauthier (aider): 6
tests/fixtures/languages/csharp/test.cs:
Paul Gauthier (aider): 39
tests/fixtures/languages/elisp/test.el:
Paul Gauthier (aider): 25
tests/fixtures/languages/elixir/test.ex:
Paul Gauthier (aider): 5
tests/fixtures/languages/elm/test.elm:
Paul Gauthier: 1
Paul Gauthier (aider): 37
tests/fixtures/languages/go/test.go:
Paul Gauthier: 1
Paul Gauthier (aider): 41
tests/fixtures/languages/java/test.java:
Paul Gauthier: 2
Paul Gauthier (aider): 14
tests/fixtures/languages/javascript/test.js:
Paul Gauthier: 1
Paul Gauthier (aider): 25
tests/fixtures/languages/ocaml/test.ml:
Paul Gauthier: 2
Paul Gauthier (aider): 17
tests/fixtures/languages/php/test.php:
Paul Gauthier (aider): 5
tests/fixtures/languages/python/test.py:
Paul Gauthier: 2
Paul Gauthier (aider): 26
tests/fixtures/languages/ql/test.ql:
Paul Gauthier (aider): 3
tests/fixtures/languages/ruby/test.rb:
Paul Gauthier (aider): 3
tests/fixtures/languages/rust/test.rs:
Paul Gauthier (aider): 33
tests/fixtures/languages/tsx/test.tsx:
Paul Gauthier (aider): 30
tests/fixtures/languages/typescript/test.ts:
Paul Gauthier (aider): 3
grand_total:
Paul Gauthier: 99
Paul Gauthier (aider): 574
Paul Gauthier: 105
Paul Gauthier (aider): 841
Philippe de Reynal: 30
start_tag: v0.65.0
total_lines: 703
total_lines: 976
- aider_percentage: 67.86
aider_total: 437
end_date: '2024-12-06'
@@ -3619,7 +3653,7 @@
apaz-cli: 18
start_tag: v0.70.0
total_lines: 391
- aider_percentage: 51.69
- aider_percentage: 48.76
aider_total: 138
end_date: '2025-01-20'
end_tag: v0.72.0
@@ -3680,13 +3714,15 @@
Paul Gauthier (aider): 39
tests/basic/test_repomap.py:
Paul Walker: 1
tests/fixtures/languages/kotlin/test.kt:
Paul Walker: 16
grand_total:
Paul Gauthier: 92
Paul Gauthier (aider): 138
Paul Walker: 28
Paul Walker: 44
Titusz Pan: 9
start_tag: v0.71.0
total_lines: 267
total_lines: 283
- aider_percentage: 69.44
aider_total: 284
end_date: '2025-01-31'
@@ -3739,3 +3775,72 @@
xqyz: 1
start_tag: v0.72.0
total_lines: 409
- aider_percentage: 77.14
aider_total: 604
end_date: '2025-02-06'
end_tag: v0.74.0
file_counts:
aider/__init__.py:
Paul Gauthier: 1
aider/args.py:
Paul Gauthier: 1
aider/coders/base_coder.py:
Paul Gauthier: 24
Paul Gauthier (aider): 9
aider/coders/editblock_coder.py:
Paul Gauthier: 5
aider/coders/wholefile_coder.py:
Paul Gauthier: 2
aider/commands.py:
Paul Gauthier: 1
aider/exceptions.py:
Paul Gauthier: 4
Paul Gauthier (aider): 6
aider/history.py:
Paul Gauthier (aider): 1
aider/io.py:
Paul Gauthier: 4
Paul Gauthier (aider): 18
aider/llm.py:
Paul Gauthier: 3
aider/main.py:
Paul Gauthier: 21
Paul Gauthier (aider): 25
aider/models.py:
Paul Gauthier: 83
Paul Gauthier (aider): 77
aider/repo.py:
Paul Gauthier: 1
Paul Gauthier (aider): 2
"Viktor Sz\xE9pe": 3
aider/watch.py:
Paul Gauthier (aider): 45
benchmark/docker.sh:
Paul Gauthier: 2
docker/Dockerfile:
Paul Gauthier: 5
Paul Gauthier (aider): 4
tests/basic/test_editblock.py:
Paul Gauthier: 7
tests/basic/test_history.py:
Paul Gauthier (aider): 13
tests/basic/test_io.py:
Paul Gauthier (aider): 46
tests/basic/test_main.py:
Paul Gauthier: 8
Paul Gauthier (aider): 1
tests/basic/test_models.py:
Paul Gauthier (aider): 297
tests/basic/test_repo.py:
Paul Gauthier (aider): 11
tests/basic/test_sendchat.py:
Paul Gauthier (aider): 7
tests/basic/test_watch.py:
Paul Gauthier: 4
Paul Gauthier (aider): 42
grand_total:
Paul Gauthier: 176
Paul Gauthier (aider): 604
"Viktor Sz\xE9pe": 3
start_tag: v0.73.0
total_lines: 783

View File

@@ -543,4 +543,56 @@
date: 2025-01-21
versions: 0.72.2.dev
seconds_per_case: 24.2
total_cost: 0.0000
total_cost: 0.0000
- dirname: 2025-02-15-19-51-22--chatgpt4o-feb15-diff
test_cases: 223
model: chatgpt-4o-latest (2025-02-15)
edit_format: diff
commit_hash: 108ce18-dirty
pass_rate_1: 9.0
pass_rate_2: 27.1
pass_num_1: 20
pass_num_2: 61
percent_cases_well_formed: 93.3
error_outputs: 66
num_malformed_responses: 21
num_with_malformed_responses: 15
user_asks: 57
lazy_comments: 0
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 2
total_tests: 225
command: aider --model chatgpt-4o-latest
date: 2025-02-15
versions: 0.74.3.dev
seconds_per_case: 12.4
total_cost: 14.3703
- dirname: 2025-02-24-19-54-07--sonnet37-diff
test_cases: 225
model: claude-3-7-sonnet-20250219
edit_format: diff
commit_hash: 75e9ee6
pass_rate_1: 24.4
pass_rate_2: 60.4
pass_num_1: 55
pass_num_2: 136
percent_cases_well_formed: 93.3
error_outputs: 16
num_malformed_responses: 16
num_with_malformed_responses: 15
user_asks: 12
lazy_comments: 0
syntax_errors: 0
indentation_errors: 0
exhausted_context_windows: 0
test_timeouts: 0
total_tests: 225
command: aider --model sonnet
date: 2025-02-24
versions: 0.74.4.dev
seconds_per_case: 28.3
total_cost: 17.7191

View File

@@ -1 +1 @@
Aider works best with Claude 3.5 Sonnet, DeepSeek V3, o1 & GPT-4o and can [connect to almost any LLM](https://aider.chat/docs/llms.html).
Aider works best with Claude 3.5 Sonnet, DeepSeek R1 & Chat V3, OpenAI o1, o3-mini & GPT-4o. Aider can [connect to almost any LLM, including local models](https://aider.chat/docs/llms.html).

File diff suppressed because it is too large Load Diff

View File

@@ -23,7 +23,7 @@
## Use claude-3-opus-20240229 model for the main chat
#opus: false
## Use claude-3-5-sonnet-20241022 model for the main chat
## Use anthropic/claude-3-7-sonnet-20250219 model for the main chat
#sonnet: false
## Use claude-3-5-haiku-20241022 model for the main chat
@@ -436,3 +436,6 @@
## Specify which editor to use for the /editor command
#editor: xxx
## Install the tree_sitter_language_pack (experimental)
#install-tree-sitter-language-pack: false

View File

@@ -27,7 +27,7 @@
## Use claude-3-opus-20240229 model for the main chat
#AIDER_OPUS=
## Use claude-3-5-sonnet-20241022 model for the main chat
## Use anthropic/claude-3-7-sonnet-20250219 model for the main chat
#AIDER_SONNET=
## Use claude-3-5-haiku-20241022 model for the main chat
@@ -404,3 +404,6 @@
## Specify which editor to use for the /editor command
#AIDER_EDITOR=
## Install the tree_sitter_language_pack (experimental)
#AIDER_INSTALL_TREE_SITTER_LANGUAGE_PACK=false

View File

@@ -173,6 +173,7 @@ cog.out("```\n")
editor_model_name: null
editor_edit_format: null
remove_reasoning: null
system_prompt_prefix: null
- name: anthropic/claude-3-5-haiku-20241022
edit_format: diff
@@ -222,6 +223,19 @@ cog.out("```\n")
editor_model_name: anthropic/claude-3-5-sonnet-20241022
editor_edit_format: editor-diff
- name: anthropic/claude-3-7-sonnet-20250219
edit_format: diff
weak_model_name: anthropic/claude-3-5-haiku-20241022
use_repo_map: true
examples_as_sys_msg: true
extra_params:
extra_headers:
anthropic-beta: prompt-caching-2024-07-31,pdfs-2024-09-25
max_tokens: 8192
cache_control: true
editor_model_name: anthropic/claude-3-7-sonnet-20250219
editor_edit_format: editor-diff
- name: anthropic/claude-3-haiku-20240307
weak_model_name: anthropic/claude-3-haiku-20240307
examples_as_sys_msg: true
@@ -263,6 +277,7 @@ cog.out("```\n")
use_temperature: false
editor_model_name: azure/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: 'Formatting re-enabled. '
- name: bedrock/anthropic.claude-3-5-haiku-20241022-v1:0
edit_format: diff
@@ -573,6 +588,7 @@ cog.out("```\n")
streaming: false
editor_model_name: gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: 'Formatting re-enabled. '
- name: o1-mini
weak_model_name: gpt-4o-mini
@@ -598,6 +614,7 @@ cog.out("```\n")
use_temperature: false
editor_model_name: gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: 'Formatting re-enabled. '
- name: openai/gpt-4o
edit_format: diff
@@ -637,6 +654,7 @@ cog.out("```\n")
streaming: false
editor_model_name: openai/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: 'Formatting re-enabled. '
- name: openai/o1-mini
weak_model_name: openai/gpt-4o-mini
@@ -662,6 +680,7 @@ cog.out("```\n")
use_temperature: false
editor_model_name: gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: 'Formatting re-enabled. '
- name: openrouter/anthropic/claude-3-opus
edit_format: diff
@@ -760,6 +779,7 @@ cog.out("```\n")
streaming: false
editor_model_name: openrouter/openai/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: 'Formatting re-enabled. '
- name: openrouter/openai/o1-mini
weak_model_name: openrouter/openai/gpt-4o-mini
@@ -787,6 +807,16 @@ cog.out("```\n")
use_temperature: false
editor_model_name: openrouter/openai/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: 'Formatting re-enabled. '
- name: openrouter/openai/o3-mini-high
edit_format: diff
weak_model_name: openrouter/openai/gpt-4o-mini
use_repo_map: true
use_temperature: false
editor_model_name: openrouter/openai/gpt-4o
editor_edit_format: editor-diff
system_prompt_prefix: 'Formatting re-enabled. '
- name: openrouter/qwen/qwen-2.5-coder-32b-instruct
edit_format: diff

View File

@@ -77,7 +77,7 @@ cog.outl("```")
## Use claude-3-opus-20240229 model for the main chat
#opus: false
## Use claude-3-5-sonnet-20241022 model for the main chat
## Use anthropic/claude-3-7-sonnet-20250219 model for the main chat
#sonnet: false
## Use claude-3-5-haiku-20241022 model for the main chat
@@ -490,5 +490,8 @@ cog.outl("```")
## Specify which editor to use for the /editor command
#editor: xxx
## Install the tree_sitter_language_pack (experimental)
#install-tree-sitter-language-pack: false
```
<!--[[[end]]]-->

View File

@@ -67,7 +67,7 @@ cog.outl("```")
## Use claude-3-opus-20240229 model for the main chat
#AIDER_OPUS=
## Use claude-3-5-sonnet-20241022 model for the main chat
## Use anthropic/claude-3-7-sonnet-20250219 model for the main chat
#AIDER_SONNET=
## Use claude-3-5-haiku-20241022 model for the main chat
@@ -444,5 +444,8 @@ cog.outl("```")
## Specify which editor to use for the /editor command
#AIDER_EDITOR=
## Install the tree_sitter_language_pack (experimental)
#AIDER_INSTALL_TREE_SITTER_LANGUAGE_PACK=false
```
<!--[[[end]]]-->

View File

@@ -60,7 +60,7 @@ for alias, model in sorted(MODEL_ALIASES.items()):
- `haiku`: claude-3-5-haiku-20241022
- `opus`: claude-3-opus-20240229
- `r1`: deepseek/deepseek-reasoner
- `sonnet`: claude-3-5-sonnet-20241022
- `sonnet`: anthropic/claude-3-7-sonnet-20250219
<!--[[[end]]]-->
## Priority

View File

@@ -79,6 +79,7 @@ usage: aider [-h] [--model] [--opus] [--sonnet] [--haiku] [--4]
[--fancy-input | --no-fancy-input]
[--multiline | --no-multiline]
[--detect-urls | --no-detect-urls] [--editor]
[--install-tree-sitter-language-pack]
```
@@ -101,7 +102,7 @@ Use claude-3-opus-20240229 model for the main chat
Environment variable: `AIDER_OPUS`
### `--sonnet`
Use claude-3-5-sonnet-20241022 model for the main chat
Use anthropic/claude-3-7-sonnet-20250219 model for the main chat
Environment variable: `AIDER_SONNET`
### `--haiku`
@@ -761,4 +762,9 @@ Aliases:
### `--editor VALUE`
Specify which editor to use for the /editor command
Environment variable: `AIDER_EDITOR`
### `--install-tree-sitter-language-pack`
Install the tree_sitter_language_pack (experimental)
Default: False
Environment variable: `AIDER_INSTALL_TREE_SITTER_LANGUAGE_PACK`
<!--[[[end]]]-->

View File

@@ -7,8 +7,10 @@ description: How to configure reasoning model settings from secondary providers.
# Reasoning models
Many
"reasoning" models have restrictions on how they can be used.
They sometimes prohibit streaming, use of temperature and/or the system prompt.
"reasoning" models have restrictions on how they can be used:
they sometimes prohibit streaming, use of temperature and/or the system prompt.
Some also support different levels of "reasoning effort".
Aider is configured to work properly with these models
when served through major provider APIs.
@@ -19,6 +21,11 @@ and see errors related to temperature or system prompt.
Include settings for your new provider in `.aider.model.setting.yml` file
at the root of your project or in your home directory.
## Reasoning effort
You can use the `--reasoning-effort` switch to control the reasoning effort
of models which support this setting.
## Temperature, streaming and system prompt
You should find one of the existing model setting configuration entries

View File

@@ -249,15 +249,16 @@ tr:hover { background-color: #f5f5f5; }
</style>
<table>
<tr><th>Model Name</th><th class='right'>Total Tokens</th><th class='right'>Percent</th></tr>
<tr><td>claude-3-5-sonnet-20241022</td><td class='right'>654,183</td><td class='right'>45.8%</td></tr>
<tr><td>fireworks_ai/accounts/fireworks/models/deepseek-v3</td><td class='right'>289,874</td><td class='right'>20.3%</td></tr>
<tr><td>o3-mini</td><td class='right'>274,564</td><td class='right'>19.2%</td></tr>
<tr><td>deepseek/deepseek-chat</td><td class='right'>97,745</td><td class='right'>6.8%</td></tr>
<tr><td>fireworks_ai/REDACTED</td><td class='right'>45,233</td><td class='right'>3.2%</td></tr>
<tr><td>fireworks_ai/accounts/fireworks/models/deepseek-r1</td><td class='right'>44,069</td><td class='right'>3.1%</td></tr>
<tr><td>deepseek/deepseek-reasoner</td><td class='right'>20,223</td><td class='right'>1.4%</td></tr>
<tr><td>gemini/REDACTED</td><td class='right'>1,859</td><td class='right'>0.1%</td></tr>
<tr><td>ollama_chat/REDACTED</td><td class='right'>309</td><td class='right'>0.0%</td></tr>
<tr><td>claude-3-5-sonnet-20241022</td><td class='right'>671,724</td><td class='right'>50.6%</td></tr>
<tr><td>fireworks_ai/accounts/fireworks/models/deepseek-v3</td><td class='right'>316,950</td><td class='right'>23.9%</td></tr>
<tr><td>o3-mini</td><td class='right'>98,659</td><td class='right'>7.4%</td></tr>
<tr><td>deepseek/deepseek-chat</td><td class='right'>87,658</td><td class='right'>6.6%</td></tr>
<tr><td>claude-3-5-haiku-20241022</td><td class='right'>69,203</td><td class='right'>5.2%</td></tr>
<tr><td>anthropic/claude-3-7-sonnet-20250219</td><td class='right'>38,305</td><td class='right'>2.9%</td></tr>
<tr><td>fireworks_ai/accounts/fireworks/models/deepseek-r1</td><td class='right'>21,182</td><td class='right'>1.6%</td></tr>
<tr><td>gpt-4o</td><td class='right'>12,595</td><td class='right'>0.9%</td></tr>
<tr><td>openrouter/openai/o3-mini</td><td class='right'>10,107</td><td class='right'>0.8%</td></tr>
<tr><td>anthropic/REDACTED</td><td class='right'>1,999</td><td class='right'>0.2%</td></tr>
</table>
{: .note :}

View File

@@ -96,14 +96,7 @@ to keep aider's dependencies separated.
You can use pip to install aider with python versions 3.9-3.12.
```bash
# Install aider
python -m pip install -U --upgrade-strategy only-if-needed aider-chat
# To work with GPT-4o:
aider --4o --openai-api-key sk-xxx...
# To work with Claude 3.5 Sonnet:
aider --sonnet --anthropic-api-key sk-xxx...
```
{% include python-m-aider.md %}

View File

@@ -17,21 +17,14 @@ Aider works best if you have git installed.
Here are
[instructions for installing git in various environments](https://github.com/git-guides/install-git).
## Get your API key
## Setup an API key
To work with OpenAI's models like GPT-4o or o1-preview you need a paid
[OpenAI API key](https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key).
Note that this is different than being a "ChatGPT Plus" subscriber.
You need an key from an API provider to work with most models:
To work with Anthropic's models like Claude 3.5 Sonnet you need a paid
[Anthropic API key](https://docs.anthropic.com/claude/reference/getting-started-with-the-api).
### Working with other LLMs
{% include works-best.md %}
### Store your api keys
- [OpenAI](https://help.openai.com/en/articles/4936850-where-do-i-find-my-secret-api-key) provides o1, o3-mini, gpt-4o and other models. Note that paying for an API key is different than being a "ChatGPT" subscriber.
- [Anthropic](https://docs.anthropic.com/claude/reference/getting-started-with-the-api) provides Claude 3.5 Sonnet and Haiku.
- [DeepSeek](https://platform.deepseek.com/api_keys) provides DeepSeek R1 and DeepSeek Chat V3.
- [OpenRouter](https://openrouter.ai/keys) allows you to access models from many providers using a single key.
You can [store your api keys in configuration or env files](/docs/config/api-keys.html)
and they will be loaded automatically whenever you run aider.
@@ -105,11 +98,3 @@ please let us know by opening a
[GitHub issue](https://github.com/Aider-AI/aider/issues).
## Install the development version of aider
If you want the very latest development version of aider
you can install it like this:
```
aider --install-main-branch
```

View File

@@ -73,7 +73,8 @@ cog.out(get_supported_languages_md())
| gomod | .gomod | | ✓ |
| hack | .hack | | ✓ |
| haskell | .hs | | ✓ |
| hcl | .hcl | | ✓ |
| hcl | .hcl | | ✓ |
| hcl | .tf | ✓ | ✓ |
| html | .html | | ✓ |
| java | .java | ✓ | ✓ |
| javascript | .js | ✓ | ✓ |

View File

@@ -116,6 +116,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.')}")
]]]-->
January 31, 2025.
February 24, 2025.
<!--[[[end]]]-->
</p>

View File

@@ -16,10 +16,9 @@ description: Aider can connect to most LLMs for AI pair programming.
Aider works best with these models, which are skilled at editing code:
- [GPT-4o](/docs/llms/openai.html)
- [DeepSeek R1 and V3](/docs/llms/deepseek.html)
- [Claude 3.5 Sonnet](/docs/llms/anthropic.html)
- [Claude 3 Opus](/docs/llms/anthropic.html)
- [DeepSeek V3](/docs/llms/deepseek.html)
- [OpenAI o1, o3-mini and GPT-4o](/docs/llms/openai.html)
## Free models

View File

@@ -44,15 +44,16 @@ setx OLLAMA_API_KEY <api-key> # Windows, restart shell after setx
[Ollama uses a 2k context window by default](https://github.com/ollama/ollama/blob/main/docs/faq.md#how-can-i-specify-the-context-window-size),
which is very small for working with aider.
It also **silently** discards context that exceeds the window.
This is especially dangerous because many users don't even realize that most of their data
is being discarded by Ollama.
By default, aider sets Ollama's context window
to be large enough for each request you send plus 8k tokens for the reply.
This ensures data isn't silently discarded by Ollama.
Larger context windows may be helpful to allow larger replies from the LLM
but will use memory and increase latency.
If you would like
a larger context window
you can use a
If you'd like you can configure a fixed sized context window instead
with an
[`.aider.model.settings.yml` file](https://aider.chat/docs/config/adv-model-settings.html#model-settings)
like this:

View File

@@ -37,12 +37,14 @@ You can use `aider --model <model-name>` to use any other OpenAI model.
For example, if you want to use a specific version of GPT-4 Turbo
you could do `aider --model gpt-4-0125-preview`.
## o1 models from other providers
## Reasoning models from other providers
Many of OpenAI's o1
Many of OpenAI's
"reasoning" models have restrictions on streaming and setting the temperature parameter.
Some also support different levels of "reasoning effort".
Aider is configured to work properly with these models
when served through major provider APIs.
when served through major provider APIs and
has a `--reasoning-effort` setting.
You may need to [configure reasoning model settings](/docs/config/reasoning.html)
if you are using them through another provider

View File

@@ -33,8 +33,7 @@ cog.out(text)
Aider lets you pair program with LLMs,
to edit code in your local git repository.
Start a new project or work with an existing code base.
Aider works best with Claude 3.5 Sonnet, DeepSeek V3, o1 & GPT-4o and can [connect to almost any LLM](https://aider.chat/docs/llms.html).
Aider works best with Claude 3.5 Sonnet, DeepSeek R1 & Chat V3, OpenAI o1, o3-mini & GPT-4o. Aider can [connect to almost any LLM, including local models](https://aider.chat/docs/llms.html).
<!--
<p align="center">

View File

@@ -4,6 +4,7 @@ FROM buildpack-deps:jammy
RUN apt-get update && apt-get install -y \
software-properties-common \
cmake \
libboost-all-dev \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y \

View File

@@ -964,9 +964,10 @@ def run_unit_tests(original_dname, testdir, history_fname, test_files):
# Copy test files from original directory
for file_path in test_files:
src = original_dname / testdir.name / file_path
src = original_dname / Path(*testdir.parts[-4:]) / file_path
dst = testdir / file_path
if src.exists():
print("copying", src, dst)
os.makedirs(dst.parent, exist_ok=True)
shutil.copy(src, dst)
@@ -988,6 +989,8 @@ def run_unit_tests(original_dname, testdir, history_fname, test_files):
text=True,
timeout=timeout,
cwd=testdir,
encoding="utf-8",
errors="replace",
)
success = result.returncode == 0

View File

@@ -5,7 +5,7 @@ set -e
[ ! -d "build" ] && mkdir build
cd build
cmake -G "Unix Makefiles" ..
cmake -DEXERCISM_RUN_ALL_TESTS=1 -G "Unix Makefiles" ..
make

View File

@@ -4,9 +4,9 @@
#
# pip-compile --allow-unsafe --output-file=requirements.txt requirements/requirements.in
#
aiohappyeyeballs==2.4.4
aiohappyeyeballs==2.4.6
# via aiohttp
aiohttp==3.11.11
aiohttp==3.11.12
# via litellm
aiosignal==1.3.2
# via aiohttp
@@ -26,9 +26,9 @@ backoff==2.2.1
# via
# -r requirements/requirements.in
# posthog
beautifulsoup4==4.12.3
beautifulsoup4==4.13.3
# via -r requirements/requirements.in
certifi==2024.12.14
certifi==2025.1.31
# via
# httpcore
# httpx
@@ -51,29 +51,29 @@ distro==1.9.0
# via openai
filelock==3.17.0
# via huggingface-hub
flake8==7.1.1
flake8==7.1.2
# via -r requirements/requirements.in
frozenlist==1.5.0
# via
# aiohttp
# aiosignal
fsspec==2024.12.0
fsspec==2025.2.0
# via huggingface-hub
gitdb==4.0.12
# via gitpython
gitpython==3.1.44
# via -r requirements/requirements.in
grep-ast==0.4.1
grep-ast==0.6.1
# via -r requirements/requirements.in
h11==0.14.0
# via httpcore
httpcore==1.0.7
# via httpx
httpx==0.27.2
httpx==0.28.1
# via
# litellm
# openai
huggingface-hub==0.28.0
huggingface-hub==0.29.0
# via tokenizers
idna==3.10
# via
@@ -99,7 +99,7 @@ jsonschema==4.23.0
# litellm
jsonschema-specifications==2024.10.1
# via jsonschema
litellm==1.59.8
litellm==1.61.9
# via -r requirements/requirements.in
markdown-it-py==3.0.0
# via rich
@@ -124,7 +124,7 @@ numpy==1.26.4
# -r requirements/requirements.in
# scipy
# soundfile
openai==1.60.2
openai==1.63.2
# via litellm
packaging==24.2
# via
@@ -138,7 +138,7 @@ pexpect==4.9.0
# via -r requirements/requirements.in
pillow==10.4.0
# via -r requirements/requirements.in
posthog==3.11.0
posthog==3.14.1
# via -r requirements/requirements.in
prompt-toolkit==3.0.50
# via -r requirements/requirements.in
@@ -146,7 +146,7 @@ propcache==0.2.1
# via
# aiohttp
# yarl
psutil==6.1.1
psutil==7.0.0
# via -r requirements/requirements.in
ptyprocess==0.7.0
# via pexpect
@@ -208,15 +208,16 @@ smmap==5.0.2
sniffio==1.3.1
# via
# anyio
# httpx
# openai
socksio==1.0.0
# via -r requirements/requirements.in
sounddevice==0.5.1
# via -r requirements/requirements.in
soundfile==0.13.1
# via -r requirements/requirements.in
soupsieve==2.6
# via beautifulsoup4
tiktoken==0.8.0
tiktoken==0.9.0
# via litellm
tokenizers==0.19.1
# via
@@ -229,12 +230,14 @@ tqdm==4.67.1
tree-sitter==0.21.3
# via
# -r requirements/requirements.in
# grep-ast
# tree-sitter-languages
tree-sitter-languages==1.10.2
# via grep-ast
typing-extensions==4.12.2
# via
# anyio
# beautifulsoup4
# huggingface-hub
# openai
# pydantic
@@ -254,5 +257,5 @@ zipp==3.21.0
# via importlib-metadata
# The following packages are considered to be unsafe in a requirements file:
pip==25.0
pip==25.0.1
# via -r requirements/requirements.in

View File

@@ -1,4 +1,4 @@
-c ../requirements.txt
streamlit
streamlit==1.41.1 # https://github.com/Aider-AI/aider/issues/3221
watchdog<5 # docker build fails: streamlit 1.38.0 depends on watchdog<5

View File

@@ -17,7 +17,7 @@ blinker==1.9.0
# via streamlit
cachetools==5.5.1
# via streamlit
certifi==2024.12.14
certifi==2025.1.31
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
@@ -92,7 +92,7 @@ mdurl==0.1.2
# -c requirements.txt
# -c requirements/requirements-dev.txt
# markdown-it-py
narwhals==1.24.0
narwhals==1.27.1
# via altair
numpy==1.26.4
# via
@@ -124,7 +124,7 @@ pillow==10.4.0
# streamlit
protobuf==5.29.3
# via streamlit
pyarrow==19.0.0
pyarrow==19.0.1
# via streamlit
pydeck==0.9.1
# via streamlit
@@ -140,7 +140,7 @@ python-dateutil==2.9.0.post0
# -c requirements.txt
# -c requirements/requirements-dev.txt
# pandas
pytz==2024.2
pytz==2025.1
# via
# -c requirements/requirements-dev.txt
# pandas

View File

@@ -6,11 +6,11 @@
#
alabaster==1.0.0
# via sphinx
babel==2.16.0
babel==2.17.0
# via sphinx
build==1.2.2.post1
# via pip-tools
certifi==2024.12.14
certifi==2025.1.31
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
@@ -28,7 +28,7 @@ click==8.1.8
# -c requirements.txt
# pip-tools
# typer
codespell==2.4.0
codespell==2.4.1
# via -r requirements/requirements-dev.in
cogapp==3.4.1
# via -r requirements/requirements-dev.in
@@ -51,9 +51,9 @@ filelock==3.17.0
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
# virtualenv
fonttools==4.55.7
fonttools==4.56.0
# via matplotlib
identify==2.6.6
identify==2.6.7
# via pre-commit
idna==3.10
# via
@@ -156,7 +156,7 @@ python-dateutil==2.9.0.post0
# -c requirements.txt
# matplotlib
# pandas
pytz==2024.2
pytz==2025.1
# via pandas
pyyaml==6.0.2
# via
@@ -173,6 +173,8 @@ rich==13.9.4
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
# typer
roman-numerals-py==3.0.0
# via sphinx
semver==3.0.4
# via -r requirements/requirements-dev.in
shellingham==1.5.4
@@ -184,7 +186,7 @@ six==1.17.0
# python-dateutil
snowballstemmer==2.2.0
# via sphinx
sphinx==8.1.3
sphinx==8.2.0
# via
# sphinx-rtd-theme
# sphinxcontrib-jquery
@@ -218,13 +220,13 @@ urllib3==2.3.0
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
# requests
virtualenv==20.29.1
virtualenv==20.29.2
# via pre-commit
wheel==0.45.1
# via pip-tools
# The following packages are considered to be unsafe in a requirements file:
pip==25.0
pip==25.0.1
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt

View File

@@ -4,12 +4,12 @@
#
# pip-compile --allow-unsafe --constraint=requirements.txt --constraint=requirements/requirements-dev.txt --output-file=requirements/requirements-help.txt requirements/requirements-help.in
#
aiohappyeyeballs==2.4.4
aiohappyeyeballs==2.4.6
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
# aiohttp
aiohttp==3.11.11
aiohttp==3.11.12
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
@@ -35,7 +35,7 @@ attrs==25.1.0
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
# aiohttp
certifi==2024.12.14
certifi==2025.1.31
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
@@ -77,7 +77,7 @@ frozenlist==1.5.0
# -c requirements.txt
# aiohttp
# aiosignal
fsspec==2024.12.0
fsspec==2025.2.0
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
@@ -98,12 +98,12 @@ httpcore==1.0.7
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
# httpx
httpx==0.27.2
httpx==0.28.1
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
# llama-index-core
huggingface-hub[inference]==0.28.0
huggingface-hub[inference]==0.29.0
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
@@ -130,7 +130,7 @@ joblib==1.4.2
# via
# nltk
# scikit-learn
llama-index-core==0.12.14
llama-index-core==0.12.19
# via
# -r requirements/requirements-help.in
# llama-index-embeddings-huggingface
@@ -142,7 +142,7 @@ markupsafe==3.0.2
# -c requirements.txt
# -c requirements/requirements-dev.txt
# jinja2
marshmallow==3.26.0
marshmallow==3.26.1
# via dataclasses-json
mpmath==1.3.0
# via sympy
@@ -238,15 +238,14 @@ scipy==1.13.1
# -c requirements.txt
# scikit-learn
# sentence-transformers
sentence-transformers==3.4.0
sentence-transformers==3.4.1
# via llama-index-embeddings-huggingface
sniffio==1.3.1
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt
# anyio
# httpx
sqlalchemy[asyncio]==2.0.37
sqlalchemy[asyncio]==2.0.38
# via
# llama-index-core
# sqlalchemy
@@ -256,7 +255,7 @@ tenacity==9.0.0
# via llama-index-core
threadpoolctl==3.5.0
# via scikit-learn
tiktoken==0.8.0
tiktoken==0.9.0
# via
# -c /Users/gauthier/Projects/aider/requirements.txt
# -c requirements.txt

View File

@@ -29,6 +29,7 @@ pexpect
json5
psutil
watchfiles
socksio
pip
# The proper dependency is networkx[default], but this brings

View File

@@ -32,12 +32,14 @@ def blame(start_tag, end_tag=None):
revision = end_tag if end_tag else "HEAD"
files = run(["git", "ls-tree", "-r", "--name-only", revision]).strip().split("\n")
test_files = [f for f in files if f.startswith("tests/fixtures/languages/") and "/test." in f]
files = [
f
for f in files
if f.endswith((".js", ".py", ".scm", ".sh", "Dockerfile", "Gemfile"))
or (f.startswith(".github/workflows/") and f.endswith(".yml"))
or f in website_files
or f in test_files
]
files = [f for f in files if not f.endswith("prompts.py")]
files = [f for f in files if not f.startswith("tests/fixtures/watch")]

View File

@@ -126,6 +126,11 @@ def find_oldest_issue(subject, all_issues):
def comment_and_close_duplicate(issue, oldest_issue):
# Skip if issue is labeled as priority
if "priority" in [label["name"] for label in issue["labels"]]:
print(f" - Skipping priority issue #{issue['number']}")
return
comment_url = (
f"{GITHUB_API_URL}/repos/{REPO_OWNER}/{REPO_NAME}/issues/{issue['number']}/comments"
)
@@ -168,7 +173,11 @@ def find_unlabeled_with_paul_comments(issues):
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)
unlabeled_issues = [
issue
for issue in find_unlabeled_with_paul_comments(all_issues)
if "priority" not in [label["name"] for label in issue["labels"]]
]
if not unlabeled_issues:
print("No unlabeled issues with paul-gauthier comments found.")
@@ -197,10 +206,12 @@ def handle_stale_issues(all_issues, auto_yes):
for issue in all_issues:
# Skip if not open, not a question, already stale, or has been reopened
labels = [label["name"] for label in issue["labels"]]
if (
issue["state"] != "open"
or "question" not in [label["name"] for label in issue["labels"]]
or "stale" in [label["name"] for label in issue["labels"]]
or "question" not in labels
or "stale" in labels
or "priority" in labels
or has_been_reopened(issue["number"])
):
continue
@@ -239,8 +250,9 @@ def handle_stale_closing(all_issues, auto_yes):
print("\nChecking for issues to close or unstale...")
for issue in all_issues:
# Skip if not open or not stale
if issue["state"] != "open" or "stale" not in [label["name"] for label in issue["labels"]]:
# Skip if not open, not stale, or is priority
labels = [label["name"] for label in issue["labels"]]
if issue["state"] != "open" or "stale" not in labels or "priority" in labels:
continue
# Get the timeline to find when the stale label was last added
@@ -324,9 +336,9 @@ def handle_fixed_issues(all_issues, auto_yes):
print("\nChecking for fixed enhancement and bug issues to close...")
for issue in all_issues:
# Skip if not open or doesn't have fixed label
# Skip if not open, doesn't have fixed label, or is priority
labels = [label["name"] for label in issue["labels"]]
if issue["state"] != "open" or "fixed" not in labels:
if issue["state"] != "open" or "fixed" not in labels or "priority" in labels:
continue
# Check if it's an enhancement or bug

View File

@@ -905,6 +905,25 @@ This command will print 'Hello, World!' to the console."""
self.assertIsInstance(exc.valid_formats, list)
self.assertTrue(len(exc.valid_formats) > 0)
def test_system_prompt_prefix(self):
# Test that system_prompt_prefix is properly set and used
io = InputOutput(yes=True)
test_prefix = "Test prefix. "
# Create a model with system_prompt_prefix
model = Model("gpt-3.5-turbo")
model.system_prompt_prefix = test_prefix
coder = Coder.create(model, None, io=io)
# Get the formatted messages
chunks = coder.format_messages()
messages = chunks.all_messages()
# Check if the system message contains our prefix
system_message = next(msg for msg in messages if msg["role"] == "system")
self.assertTrue(system_message["content"].startswith(test_prefix))
def test_coder_create_with_new_file_oserror(self):
with GitTemporaryDirectory():
io = InputOutput(yes=True)

View File

@@ -1,8 +1,6 @@
import os
from unittest.mock import MagicMock, patch
import pytest
from aider.editor import (
DEFAULT_EDITOR_NIX,
DEFAULT_EDITOR_OS_X,
@@ -21,7 +19,7 @@ def test_get_environment_editor():
assert get_environment_editor("default") == "default"
# Test EDITOR precedence
with patch.dict(os.environ, {"EDITOR": "vim"}):
with patch.dict(os.environ, {"EDITOR": "vim"}, clear=True):
assert get_environment_editor() == "vim"
# Test VISUAL overrides EDITOR
@@ -34,17 +32,17 @@ def test_discover_editor_defaults():
# Test Windows default
mock_system.return_value = "Windows"
with patch.dict(os.environ, {}, clear=True):
assert discover_editor() == [DEFAULT_EDITOR_WINDOWS]
assert discover_editor() == DEFAULT_EDITOR_WINDOWS
# Test macOS default
mock_system.return_value = "Darwin"
with patch.dict(os.environ, {}, clear=True):
assert discover_editor() == [DEFAULT_EDITOR_OS_X]
assert discover_editor() == DEFAULT_EDITOR_OS_X
# Test Linux default
mock_system.return_value = "Linux"
with patch.dict(os.environ, {}, clear=True):
assert discover_editor() == [DEFAULT_EDITOR_NIX]
assert discover_editor() == DEFAULT_EDITOR_NIX
def test_write_temp_file():
@@ -81,12 +79,44 @@ def test_print_status_message(capsys):
def test_discover_editor_override():
# Test editor override
assert discover_editor("code") == ["code"]
assert discover_editor('vim -c "set noswapfile"') == ["vim", "-c", "set noswapfile"]
assert discover_editor("code") == "code"
assert discover_editor('vim -c "set noswapfile"') == 'vim -c "set noswapfile"'
# Test invalid editor command
with pytest.raises(RuntimeError):
discover_editor('vim "unclosed quote')
def test_pipe_editor_with_fake_editor():
# Create a temporary Python script that logs its arguments
import sys
import tempfile
with tempfile.NamedTemporaryFile(mode="w", suffix=".log", delete=False) as log_f:
log_path = log_f.name
# Convert to raw string path to avoid escape issues on Windows
log_path_escaped = log_path.replace("\\", "\\\\")
with tempfile.NamedTemporaryFile(mode="w", suffix=".py", delete=False) as f:
f.write(f"""import sys
with open(r"{log_path_escaped}", "w") as f:
f.write(" ".join(sys.argv))
""")
script_path = f.name
try:
# Use the Python script as editor and verify it's called with .md file
python_exe = sys.executable
editor_cmd = f"{python_exe} {script_path}"
pipe_editor("test content", suffix="md", editor=editor_cmd)
# Read the log file to see what arguments were passed
with open(log_path) as f:
called_args = f.read().strip()
# Verify the editor was called with a .md file
assert called_args.endswith(".md"), f"Called args: {called_args!r}"
finally:
# Clean up
os.unlink(script_path)
os.unlink(log_path)
def test_pipe_editor():

View File

@@ -123,7 +123,7 @@ class TestModels(unittest.TestCase):
self.assertEqual(model.name, "gpt-3.5-turbo")
model = Model("sonnet")
self.assertEqual(model.name, "claude-3-5-sonnet-20241022")
self.assertEqual(model.name, "anthropic/claude-3-7-sonnet-20250219")
model = Model("haiku")
self.assertEqual(model.name, "claude-3-5-haiku-20241022")

View File

@@ -303,6 +303,7 @@ class TestRepoMapAllLanguages(unittest.TestCase):
"elisp": ("el", "greeter"),
"elm": ("elm", "Person"),
"go": ("go", "Greeter"),
"hcl": ("tf", "aws_vpc"),
}
fixtures_dir = Path(__file__).parent.parent / "fixtures" / "languages"

52
tests/fixtures/languages/hcl/test.tf vendored Normal file
View File

@@ -0,0 +1,52 @@
# Variables
variable "aws_region" {
description = "AWS region for resources"
type = string
default = "us-west-2"
}
variable "environment" {
description = "Environment name"
type = string
default = "dev"
}
# Provider configuration
provider "aws" {
region = var.aws_region
}
# Resource definitions
resource "aws_vpc" "main" {
cidr_block = "10.0.0.0/16"
enable_dns_hostnames = true
enable_dns_support = true
tags = {
Name = "${var.environment}-vpc"
Environment = var.environment
}
}
resource "aws_subnet" "public" {
vpc_id = aws_vpc.main.id
cidr_block = "10.0.1.0/24"
availability_zone = "${var.aws_region}a"
map_public_ip_on_launch = true
tags = {
Name = "${var.environment}-public-subnet"
Environment = var.environment
}
}
# Output values
output "vpc_id" {
description = "ID of the created VPC"
value = aws_vpc.main.id
}
output "subnet_id" {
description = "ID of the public subnet"
value = aws_subnet.public.id
}