fix: Use repo map only when map_tokens is greater than 0

This commit is contained in:
Paul Gauthier 2024-08-06 09:11:21 -03:00 committed by Paul Gauthier (aider)
parent e20657096f
commit fb0691914c
2 changed files with 2 additions and 2 deletions

View file

@ -317,7 +317,7 @@ class Coder:
use_repo_map = main_model.use_repo_map
map_tokens = 1024
else:
use_repo_map = True
use_repo_map = map_tokens > 0
max_inp_tokens = self.main_model.info.get("max_input_tokens") or 0

View file

@ -384,7 +384,7 @@ class TestMain(TestCase):
input=DummyInput(),
output=DummyOutput(),
)
MockRepoMap.assert_called_once()
MockRepoMap.assert_not_called()
def test_map_tokens_option_with_non_zero_value(self):
with GitTemporaryDirectory():