Added --restore-chat-history

This commit is contained in:
Paul Gauthier 2024-05-13 11:09:28 -07:00
parent 6d75dc62d7
commit ea05cf05e1
4 changed files with 14 additions and 2 deletions

View file

@ -1,7 +1,11 @@
# 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.

View file

@ -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")

View file

@ -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)

View file

@ -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: