diff --git a/aider/coder.py b/aider/coder.py index f6da50f4b..19c9bd045 100755 --- a/aider/coder.py +++ b/aider/coder.py @@ -185,13 +185,12 @@ class Coder: files_messages = [ dict(role="user", content=all_content), dict(role="assistant", content="Ok."), - dict( - role="system", - content=prompts.files_content_suffix + prompts.system_reminder, - ), ] + if self.abs_fnames: + files_messages += [ + dict(role="system", content=prompts.system_reminder), + ] - utils.show_messages(files_messages, "FILES") return files_messages def run(self): @@ -269,7 +268,7 @@ class Coder: messages += self.get_files_messages() messages += self.cur_messages - # utils.show_messages(messages, "all") + utils.show_messages(messages, "all") content, interrupted = self.send(messages) if interrupted: diff --git a/aider/prompts.py b/aider/prompts.py index 8d6c53d22..0518b5978 100644 --- a/aider/prompts.py +++ b/aider/prompts.py @@ -31,6 +31,8 @@ Once you understand the user's request and can see all the relevant code, your r """ system_reminder = ''' +Base any edits on the current contents of the files as shown in the user's last message. + You MUST format EVERY code change using an *edit block* like this example: ```python @@ -84,12 +86,8 @@ files_content_prefix = ( ) repo_content_prefix = ( - "Here is a map showing all the {other}files and ctags content. You *must* ask with the full" - " path of the file before suggesting edits to these files:\n\n" -) - -files_content_suffix = ( - """Base any edits on the current contents of the files as shown in the user's last message.""" + "Here is a map showing all the {other}files and selected ctags content. You *must* ask with the" + " full path of the file before suggesting edits to these files:\n\n" )