feat: Skip scanning files larger than 1MB for AI comments

This commit is contained in:
Paul Gauthier (aider) 2025-04-25 07:54:32 -07:00
parent 22f140ac05
commit e743394537

View file

@ -104,6 +104,10 @@ class FileWatcher:
if self.verbose:
dump("ok", rel_path)
# Check file size before reading content
if path_abs.is_file() and path_abs.stat().st_size > 1 * 1024 * 1024: # 1MB limit
return False
# Check if file contains AI markers
try:
comments, _, _ = self.get_ai_comments(str(path_abs))