diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index 8289e2ce4..a78ca30a9 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -231,6 +231,7 @@ class Coder: attribute_committer=True, attribute_commit_message=False, aider_commit_hashes=None, + map_mul_no_files=8, ): if not fnames: fnames = [] @@ -323,6 +324,7 @@ class Coder: if not self.repo: self.find_common_root() + max_inp_tokens = self.main_model.info.get("max_input_tokens") or 0 if main_model.use_repo_map and self.repo and self.gpt_prompts.repo_content_prefix: self.repo_map = RepoMap( map_tokens, @@ -331,7 +333,8 @@ class Coder: io, self.gpt_prompts.repo_content_prefix, self.verbose, - self.main_model.info.get("max_input_tokens"), + max_inp_tokens, + map_mul_no_files=map_mul_no_files, ) if max_chat_history_tokens is None: diff --git a/aider/commands.py b/aider/commands.py index 571b9372b..36cc020ca 100644 --- a/aider/commands.py +++ b/aider/commands.py @@ -662,6 +662,8 @@ class Commands: from_coder=self.coder, edit_format="help", summarize_from_coder=False, + map_tokens=512, + map_mul_no_files=1, ) user_msg = self.help.ask(args) user_msg += """ diff --git a/aider/repomap.py b/aider/repomap.py index 381a61d46..b9dc3662a 100644 --- a/aider/repomap.py +++ b/aider/repomap.py @@ -41,6 +41,7 @@ class RepoMap: repo_content_prefix=None, verbose=False, max_context_window=None, + map_mul_no_files=8, ): self.io = io self.verbose = verbose @@ -52,6 +53,7 @@ class RepoMap: self.load_tags_cache() self.max_map_tokens = map_tokens + self.map_mul_no_files = map_mul_no_files self.max_context_window = max_context_window self.token_count = main_model.token_count @@ -70,10 +72,12 @@ class RepoMap: max_map_tokens = self.max_map_tokens # With no files in the chat, give a bigger view of the entire repo - MUL = 8 padding = 4096 if max_map_tokens and self.max_context_window: - target = min(max_map_tokens * MUL, self.max_context_window - padding) + target = min( + max_map_tokens * self.map_mul_no_files, + self.max_context_window - padding, + ) else: target = 0 if not chat_files and self.max_context_window and target > 0: