Skip to content

Commit

Permalink
Avoid unnecessary duplicate call to expensive get_repo_map() method
Browse files Browse the repository at this point in the history
  • Loading branch information
Finndersen committed Jan 30, 2025
1 parent 9c2bd58 commit ceb840b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aider/coders/base_coder.py
Original file line number Diff line number Diff line change
Expand Up @@ -722,13 +722,13 @@ def get_readonly_files_messages(self):

return readonly_messages

def get_chat_files_messages(self):
def get_chat_files_messages(self, repo_map_included):
chat_files_messages = []
if self.abs_fnames:
files_content = self.gpt_prompts.files_content_prefix
files_content += self.get_files_content()
files_reply = self.gpt_prompts.files_content_assistant_reply
elif self.get_repo_map() and self.gpt_prompts.files_no_full_files_with_repo_map:
elif repo_map_included and self.gpt_prompts.files_no_full_files_with_repo_map:
files_content = self.gpt_prompts.files_no_full_files_with_repo_map
files_reply = self.gpt_prompts.files_no_full_files_with_repo_map_reply
else:
Expand Down Expand Up @@ -1120,7 +1120,7 @@ def format_chat_chunks(self):

chunks.repo = self.get_repo_messages()
chunks.readonly_files = self.get_readonly_files_messages()
chunks.chat_files = self.get_chat_files_messages()
chunks.chat_files = self.get_chat_files_messages(repo_map_included=bool(chunks.repo))

if self.gpt_prompts.system_reminder:
reminder_message = [
Expand Down

0 comments on commit ceb840b

Please sign in to comment.