From 079682b29e6c19c0ca9fda88fc59c5a4933d87c3 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Mon, 26 Jun 2023 10:21:27 -0700 Subject: [PATCH] Omit the "No changes are needed" redaction from commit messages with wholefile coders --- aider/coders/wholefile_coder.py | 9 +++++++++ aider/coders/wholefile_func_coder.py | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/aider/coders/wholefile_coder.py b/aider/coders/wholefile_coder.py index cc7cb3980..c37f531bb 100644 --- a/aider/coders/wholefile_coder.py +++ b/aider/coders/wholefile_coder.py @@ -20,6 +20,15 @@ class WholeFileCoder(Coder): else: self.cur_messages += [dict(role="assistant", content=content)] + def get_context_from_history(self, history): + context = "" + if history: + context += "# Context:\n" + for msg in history: + if msg["role"] == "user": + context += msg["role"].upper() + ": " + msg["content"] + "\n" + return context + def render_incremental_response(self, final): return self.update_files(mode="diff") diff --git a/aider/coders/wholefile_func_coder.py b/aider/coders/wholefile_func_coder.py index c344aca04..f45ef48a7 100644 --- a/aider/coders/wholefile_func_coder.py +++ b/aider/coders/wholefile_func_coder.py @@ -57,6 +57,15 @@ class WholeFileFunctionCoder(Coder): else: self.cur_messages += [dict(role="assistant", content=content)] + def get_context_from_history(self, history): + context = "" + if history: + context += "# Context:\n" + for msg in history: + if msg["role"] == "user": + context += msg["role"].upper() + ": " + msg["content"] + "\n" + return context + def render_incremental_response(self, final=False): if self.partial_response_content: return self.partial_response_content