Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimisation: Avoid unnecessary duplicate call to expensive get_repo_map() method #3080

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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