feat: Improve history, faq, and linter tests for Windows and special chars

This commit is contained in:
Paul Gauthier 2025-05-07 16:53:18 -07:00 committed by Paul Gauthier (aider)
parent 4ec075d290
commit c72e5fcc5e
5 changed files with 51 additions and 9 deletions

View file

@ -13,6 +13,16 @@
- Add common file types (`.svg`, `.pdf`) to the default list of ignored files for AI comment scanning (`--watch`). - Add common file types (`.svg`, `.pdf`) to the default list of ignored files for AI comment scanning (`--watch`).
- Skip scanning files larger than 1MB for AI comments (`--watch`). - Skip scanning files larger than 1MB for AI comments (`--watch`).
- Aider wrote 67% of the code in this release. - Aider wrote 67% of the code in this release.
### main branch
- Set development version to 0.82.4.dev.
- Improved cost calculation using `litellm.completion_cost` where available.
- Fixed linter command execution on Windows by adopting `oslex` for argument quoting, by Titusz Pan.
- Enabled support for `thinking_tokens` and `reasoning_effort` parameters for OpenRouter models.
- Added support for `gemini-2.5-pro-preview-05-06` models.
- Added model settings for `openrouter/google/gemini-2.5-pro-preview-03-25`.
- Aider wrote 67% of the code in this release.
### Aider v0.82.2 ### Aider v0.82.2

View file

@ -37,6 +37,16 @@ cog.out(text)
- Add common file types (`.svg`, `.pdf`) to the default list of ignored files for AI comment scanning (`--watch`). - Add common file types (`.svg`, `.pdf`) to the default list of ignored files for AI comment scanning (`--watch`).
- Skip scanning files larger than 1MB for AI comments (`--watch`). - Skip scanning files larger than 1MB for AI comments (`--watch`).
- Aider wrote 67% of the code in this release. - Aider wrote 67% of the code in this release.
### main branch
- Set development version to 0.82.4.dev.
- Improved cost calculation using `litellm.completion_cost` where available.
- Fixed linter command execution on Windows by adopting `oslex` for argument quoting, by Titusz Pan.
- Enabled support for `thinking_tokens` and `reasoning_effort` parameters for OpenRouter models.
- Added support for `gemini-2.5-pro-preview-05-06` models.
- Added model settings for `openrouter/google/gemini-2.5-pro-preview-03-25`.
- Aider wrote 67% of the code in this release.
### Aider v0.82.2 ### Aider v0.82.2

View file

@ -1,9 +1,3 @@
{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173231}
{"event": "model warning", "properties": {"main_model": "gemini/REDACTED", "weak_model": "gemini/REDACTED", "editor_model": "gemini/REDACTED"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173234}
{"event": "exit", "properties": {"reason": "Keyboard interrupt during model warnings"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173235}
{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173477}
{"event": "repo", "properties": {"num_files": 613}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173478}
{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173478}
{"event": "cli session", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173478} {"event": "cli session", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173478}
{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173651} {"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173651}
{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff", "prompt_tokens": 13344, "completion_tokens": 1294, "total_tokens": 14638, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173666} {"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff", "prompt_tokens": 13344, "completion_tokens": 1294, "total_tokens": 14638, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1745173666}
@ -998,3 +992,9 @@
{"event": "repo", "properties": {"num_files": 617}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746660774} {"event": "repo", "properties": {"num_files": 617}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746660774}
{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746660774} {"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746660774}
{"event": "exit", "properties": {"reason": "Completed lint/test/commit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746660777} {"event": "exit", "properties": {"reason": "Completed lint/test/commit"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746660777}
{"event": "launched", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746661684}
{"event": "no-repo", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746661684}
{"event": "auto_commits", "properties": {"enabled": true}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746661684}
{"event": "message_send_starting", "properties": {}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746661684}
{"event": "message_send", "properties": {"main_model": "gemini/gemini-2.5-pro-exp-03-25", "weak_model": "gemini/gemini-2.0-flash", "editor_model": "gemini/gemini-2.5-pro-exp-03-25", "edit_format": "udiff-simple", "prompt_tokens": 6018, "completion_tokens": 231, "total_tokens": 6249, "cost": 0, "total_cost": 0.0}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746661749}
{"event": "exit", "properties": {"reason": "Completed --message"}, "user_id": "c42c4e6b-f054-44d7-ae1f-6726cc41da88", "time": 1746661749}

View file

@ -264,9 +264,9 @@ tr:hover { background-color: #f5f5f5; }
</style> </style>
<table> <table>
<tr><th>Model Name</th><th class='right'>Total Tokens</th><th class='right'>Percent</th></tr> <tr><th>Model Name</th><th class='right'>Total Tokens</th><th class='right'>Percent</th></tr>
<tr><td>gemini/gemini-2.5-pro-exp-03-25</td><td class='right'>1,315,564</td><td class='right'>67.0%</td></tr> <tr><td>gemini/gemini-2.5-pro-exp-03-25</td><td class='right'>1,321,813</td><td class='right'>67.1%</td></tr>
<tr><td>gemini/gemini-2.5-pro-preview-03-25</td><td class='right'>442,019</td><td class='right'>22.5%</td></tr> <tr><td>gemini/gemini-2.5-pro-preview-03-25</td><td class='right'>442,019</td><td class='right'>22.4%</td></tr>
<tr><td>o3</td><td class='right'>138,842</td><td class='right'>7.1%</td></tr> <tr><td>o3</td><td class='right'>138,842</td><td class='right'>7.0%</td></tr>
<tr><td>openrouter/anthropic/claude-3.7-sonnet</td><td class='right'>41,017</td><td class='right'>2.1%</td></tr> <tr><td>openrouter/anthropic/claude-3.7-sonnet</td><td class='right'>41,017</td><td class='right'>2.1%</td></tr>
<tr><td>gemini/gemini-2.5-flash-preview-04-17</td><td class='right'>10,305</td><td class='right'>0.5%</td></tr> <tr><td>gemini/gemini-2.5-flash-preview-04-17</td><td class='right'>10,305</td><td class='right'>0.5%</td></tr>
<tr><td>gemini/gemini-2.5-pro-preview-05-06</td><td class='right'>8,576</td><td class='right'>0.4%</td></tr> <tr><td>gemini/gemini-2.5-pro-preview-05-06</td><td class='right'>8,576</td><td class='right'>0.4%</td></tr>

View file

@ -41,6 +41,7 @@ class TestLinter(unittest.TestCase):
if os.name != "nt": if os.name != "nt":
self.skipTest("This test only runs on Windows") self.skipTest("This test only runs on Windows")
from pathlib import Path from pathlib import Path
root = Path(__file__).parent.parent.parent.absolute().as_posix() root = Path(__file__).parent.parent.parent.absolute().as_posix()
linter = Linter(encoding="utf-8", root=root) linter = Linter(encoding="utf-8", root=root)
result = linter.run_cmd("dir", "tests\\basic", "code") result = linter.run_cmd("dir", "tests\\basic", "code")
@ -57,6 +58,27 @@ class TestLinter(unittest.TestCase):
self.assertIsNotNone(result) self.assertIsNotNone(result)
self.assertIn("Error message", result.text) self.assertIn("Error message", result.text)
def test_run_cmd_with_special_chars(self):
with patch("subprocess.Popen") as mock_popen:
mock_process = MagicMock()
mock_process.returncode = 1
mock_process.stdout.read.side_effect = ("Error message", None)
mock_popen.return_value = mock_process
# Test with a file path containing special characters
special_path = "src/(main)/product/[id]/page.tsx"
result = self.linter.run_cmd("eslint", special_path, "code")
# Verify that the command was constructed correctly
mock_popen.assert_called_once()
call_args = mock_popen.call_args[0][0]
self.assertIn(special_path, call_args)
# The result should contain the error message
self.assertIsNotNone(result)
self.assertIn("Error message", result.text)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()