diff --git a/aider/models.py b/aider/models.py index 73ed42300..32f640675 100644 --- a/aider/models.py +++ b/aider/models.py @@ -754,10 +754,9 @@ class ModelInfoManager: pass except Exception as ex: print(str(ex)) - finally: - # Touch the cache file to update its mtime even if download failed try: - self.cache_file.touch() + # Save empty dict to cache file on failure + self.cache_file.write_text("{}") except OSError: pass