Merge branch 'main' of github.com:Aider-AI/aider

This commit is contained in:
Paul Gauthier 2025-06-25 10:51:42 -07:00
commit d5ae9eff88
5 changed files with 115 additions and 5 deletions

View file

@ -1316,12 +1316,23 @@ class Commands:
# First collect all expanded paths
for pattern in filenames:
expanded_pattern = expanduser(pattern)
if os.path.isabs(expanded_pattern):
# For absolute paths, glob it
matches = list(glob.glob(expanded_pattern))
path_obj = Path(expanded_pattern)
is_abs = path_obj.is_absolute()
if not is_abs:
path_obj = Path(self.coder.root) / path_obj
matches = []
# Check for literal path existence first
if path_obj.exists():
matches = [path_obj]
else:
# For relative paths and globs, use glob from the root directory
matches = list(Path(self.coder.root).glob(expanded_pattern))
# If literal path doesn't exist, try globbing
if is_abs:
# For absolute paths, glob it
matches = [Path(p) for p in glob.glob(expanded_pattern)]
else:
# For relative paths and globs, use glob from the root directory
matches = list(Path(self.coder.root).glob(expanded_pattern))
if not matches:
self.io.tool_error(f"No matches found for: {pattern}")

View file

@ -307,10 +307,13 @@ class InputOutput:
self.yes = yes
if input_history_file is not None:
Path(input_history_file).mkdir(parents=True, exist_ok=True)
self.input_history_file = input_history_file
self.llm_history_file = llm_history_file
if chat_history_file is not None:
self.chat_history_file = Path(chat_history_file)
self.chat_history_file.parent.mkdir(parents=True, exist_ok=True)
else:
self.chat_history_file = None

View file

@ -276,6 +276,61 @@
"supports_tool_choice": true,
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
},
"vertex_ai/gemini-2.5-pro": {
"max_tokens": 65536,
"max_input_tokens": 1048576,
"max_output_tokens": 65536,
"max_images_per_prompt": 3000,
"max_videos_per_prompt": 10,
"max_video_length": 1,
"max_audio_length_hours": 8.4,
"max_audio_per_prompt": 1,
"max_pdf_size_mb": 20,
"input_cost_per_token": 0.00000125,
"input_cost_per_token_above_200k_tokens": 0.0000025,
"output_cost_per_token": 0.00001,
"output_cost_per_token_above_200k_tokens": 0.000015,
"litellm_provider": "vertex_ai-language-models",
"mode": "chat",
"rpm": 2000,
"tpm": 8000000,
"supports_system_messages": true,
"supports_function_calling": true,
"supports_vision": true,
"supports_response_schema": true,
"supports_audio_output": false,
"supports_tool_choice": true,
"supported_modalities": ["text", "image", "audio", "video"],
"supported_output_modalities": ["text"],
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
},
"vertex_ai/gemini-2.5-flash": {
"max_tokens": 65536,
"max_input_tokens": 1048576,
"max_output_tokens": 65536,
"max_images_per_prompt": 3000,
"max_videos_per_prompt": 10,
"max_video_length": 1,
"max_audio_length_hours": 8.4,
"max_audio_per_prompt": 1,
"max_pdf_size_mb": 20,
"input_cost_per_token": 0.0000003,
"input_cost_per_audio_token": 0.000001,
"output_cost_per_token": 0.0000025,
"litellm_provider": "vertex_ai-language-models",
"mode": "chat",
"rpm": 10000,
"tpm": 8000000,
"supports_system_messages": true,
"supports_function_calling": true,
"supports_vision": true,
"supports_response_schema": true,
"supports_audio_output": false,
"supports_tool_choice": true,
"supported_modalities": ["text", "image", "audio", "video"],
"supported_output_modalities": ["text"],
"source": "https://cloud.google.com/vertex-ai/generative-ai/pricing"
},
"openrouter/google/gemini-2.5-pro-preview-03-25": {
"max_tokens": 8192,
"max_input_tokens": 1048576,

View file

@ -1474,6 +1474,20 @@
editor_model_name: vertex_ai/gemini-2.5-flash-preview-04-17
accepts_settings: ["thinking_tokens"]
- name: vertex_ai/gemini-2.5-pro
edit_format: diff-fenced
use_repo_map: true
weak_model_name: vertex_ai/gemini-2.5-flash
overeager: true
editor_model_name: vertex_ai/gemini-2.5-flash
accepts_settings: ["thinking_tokens"]
- name: vertex_ai/gemini-2.5-flash
overeager: true
edit_format: diff-fenced
use_repo_map: true
accepts_settings: ["thinking_tokens"]
- name: openrouter/google/gemini-2.5-pro-preview-05-06
overeager: true
edit_format: diff-fenced

View file

@ -1621,6 +1621,33 @@ class TestCommands(TestCase):
# Clean up: remove the test file from the home directory
test_file.unlink()
# pytest tests/basic/test_commands.py -k test_cmd_read_only_with_square_brackets
def test_cmd_read_only_with_square_brackets(self):
with GitTemporaryDirectory() as repo_dir:
io = InputOutput(pretty=False, fancy_input=False, yes=False)
coder = Coder.create(self.GPT35, None, io)
commands = Commands(io, coder)
# Create test layout
test_dir = Path(repo_dir) / "[id]"
test_dir.mkdir()
test_file = Path(repo_dir) / "[id]" / "page.tsx"
test_file.write_text("Test file")
# Test the /read-only command
commands.cmd_read_only("[id]/page.tsx")
# Check if test file was added to abs_read_only_fnames
self.assertTrue(
any(os.path.samefile(str(test_file), fname) for fname in coder.abs_read_only_fnames)
)
# Test dropping all read-only files
commands.cmd_drop("[id]/page.tsx")
# Check if all files were removed from abs_read_only_fnames
self.assertEqual(len(coder.abs_read_only_fnames), 0)
def test_cmd_diff(self):
with GitTemporaryDirectory() as repo_dir:
repo = git.Repo(repo_dir)