diff --git a/HISTORY.md b/HISTORY.md index fdaa14896..40d45a345 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -3,8 +3,17 @@ ### main branch +- Prompt caching for Anthropic models with `--cache-prompts`. + - Caches the system prompt, repo map and `/read-only` files. +- Repo map recomputes less often in large/mono repos or when caching enabled. + - Use `--map-refresh ` to configure. +- Improved cost estimate logic for caching. - Improved editing performance on Jupyter Notebook `.ipynb` files. -- Work around litellm tokenizer bug for images. +- Show which config yaml file is loaded with `--verbose`. +- Bumped dependency versions. +- Bugfix: properly load `.aider.models.metadata.json` data. +- Bugfix: Using `--msg /ask ...` caused an exception. +- Bugfix: litellm tokenizer bug for images. ### Aider v0.50.1 diff --git a/aider/args.py b/aider/args.py index 71d42e34d..d1b6e581d 100644 --- a/aider/args.py +++ b/aider/args.py @@ -205,13 +205,13 @@ def get_parser(default_config_files, git_root): "--map-refresh", choices=["auto", "always", "files", "manual"], default="auto", - help="Control when the repo map is refreshed (default: auto)", + help="Control how often the repo map is refreshed (default: auto)", ) group.add_argument( "--cache-prompts", action=argparse.BooleanOptionalAction, default=False, - help="Enable caching of prompts (forces map_refresh='files') (default: False)", + help="Enable caching of prompts (default: False)", ) group.add_argument( "--max-chat-history-tokens", diff --git a/aider/commands.py b/aider/commands.py index 12f45be27..89fc52494 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -1017,7 +1017,7 @@ class Commands: except Exception as e: self.io.tool_error(f"Error processing clipboard content: {e}") - def cmd_read(self, args): + def cmd_read_only(self, args): "Add a file to the chat that is for reference, not to be edited" if not args.strip(): self.io.tool_error("Please provide a filename to read.") diff --git a/aider/main.py b/aider/main.py index 193a4923d..161438c1a 100644 --- a/aider/main.py +++ b/aider/main.py @@ -507,7 +507,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F args.max_chat_history_tokens or main_model.max_chat_history_tokens, ) - if args.cache_prompts: + if args.cache_prompts and args.map_refresh == "auto": args.map_refresh = "files" try: diff --git a/tests/basic/test_main.py b/tests/basic/test_main.py index 87594872d..6cd7de107 100644 --- a/tests/basic/test_main.py +++ b/tests/basic/test_main.py @@ -530,8 +530,6 @@ class TestMain(TestCase): MockRepoMap.assert_called_once() call_args, call_kwargs = MockRepoMap.call_args - self.assertEqual(call_args[0], 1024) # Check the first positional argument - self.assertEqual(call_args[1], temp_dir) # Check the second positional argument self.assertEqual( call_kwargs.get("refresh"), "files" ) # Check the 'refresh' keyword argument