From 13c617ed44ce128b97f640c147937c25f6aab382 Mon Sep 17 00:00:00 2001 From: Paul Gauthier Date: Tue, 6 Aug 2024 08:41:40 -0300 Subject: [PATCH] fix: make new dicts and sets for each instance --- aider/coders/base_coder.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/aider/coders/base_coder.py b/aider/coders/base_coder.py index c2276c266..7fe2451a6 100755 --- a/aider/coders/base_coder.py +++ b/aider/coders/base_coder.py @@ -51,7 +51,6 @@ class Coder: abs_fnames = None repo = None last_aider_commit_hash = None - aider_commit_hashes = set() aider_edited_files = None last_asked_for_commit_time = 0 repo_map = None @@ -70,8 +69,6 @@ class Coder: lint_outcome = None test_outcome = None multi_response_content = "" - rejected_urls = set() - abs_root_path_cache = {} @classmethod def create( @@ -219,6 +216,10 @@ class Coder: summarizer=None, total_cost=0.0, ): + self.aider_commit_hashes = set() + self.rejected_urls = set() + self.abs_root_path_cache = {} + if not fnames: fnames = [] @@ -398,10 +399,14 @@ class Coder: return True def abs_root_path(self, path): - if path not in self.abs_root_path_cache: - res = Path(self.root) / path - self.abs_root_path_cache[path] = utils.safe_abs_path(res) - return self.abs_root_path_cache[path] + key = path + if key in self.abs_root_path_cache: + return self.abs_root_path_cache[key] + + res = Path(self.root) / path + res = utils.safe_abs_path(res) + self.abs_root_path_cache[key] = res + return res fences = [ ("``" + "`", "``" + "`"),