From ea05cf05e10dac49419eb3626c2465cda9592f2e Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 13 May 2024 11:09:28 -0700 Subject: [PATCH] Added --restore-chat-history --- HISTORY.md | 6 +++++- aider/args.py | 6 ++++++ aider/coders/base_coder.py | 3 ++- aider/main.py | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index ab27a2a45..9cced0da2 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,8 +1,12 @@ # Release history -### main +### v0.35.0 +- Aider now uses GPT-4o by default. + - GPT-4o tops the aider LLM code editing leaderboard at 72.9%, versus 68.4% for Opus. + - GPT-4o takes second on aider's refactoring leaderboard with 62.9%, versus Opus at 72.3%. + - Restores prior chat history on launch, so you can continue the last conversation. ### v0.34.0 diff --git a/aider/args.py b/aider/args.py index a8f4601d3..1f60c2ae2 100644 --- a/aider/args.py +++ b/aider/args.py @@ -196,6 +196,12 @@ def get_parser(default_config_files, git_root): default=default_chat_history_file, help=f"Specify the chat history file (default: {default_chat_history_file})", ) + group.add_argument( + "--restore-chat-history", + action=argparse.BooleanOptionalAction, + default=False, + help="Restore the previous chat history messages (default: False)", + ) ########## group = parser.add_argument_group("Output Settings") diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index bc85fa19a..56826485e 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -192,6 +192,7 @@ class Coder: cur_messages=None, done_messages=None, max_chat_history_tokens=None, + restore_chat_history=False, ): if not fnames: fnames = [] @@ -296,7 +297,7 @@ class Coder: self.summarizer_thread = None self.summarized_done_messages = [] - if not self.done_messages: + if not self.done_messages and restore_chat_history: history_md = self.io.read_text(self.io.chat_history_file) if history_md: self.done_messages = utils.split_chat_history_markdown(history_md) diff --git a/aider/main.py b/aider/main.py index 9c7bedab4..2074cf803 100644 --- a/aider/main.py +++ b/aider/main.py @@ -331,6 +331,7 @@ def main(argv=None, input=None, output=None, force_git_root=None, return_coder=F voice_language=args.voice_language, aider_ignore_file=args.aiderignore, max_chat_history_tokens=args.max_chat_history_tokens, + restore_chat_history=args.restore_chat_history, ) except ValueError as err: