From ff166d59f5f9828cbc8ed2888b521d05a543e7b4 Mon Sep 17 00:00:00 2001 From: LiZongbo Date: Thu, 27 Mar 2025 20:19:11 +0800 Subject: [PATCH] Fix file retrieval logic to skip files with names starting with ~$ Optimize file retrieval logic to skip files with names starting with `~$` to avoid `PermissionError`. * Add a check in the `get_all_files` method in `src/autocoder/rag/cache/simple_cache.py` to skip files with names starting with `~$`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/allwefantasy/auto-coder?shareId=XXXX-XXXX-XXXX-XXXX). --- src/autocoder/rag/cache/simple_cache.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/autocoder/rag/cache/simple_cache.py b/src/autocoder/rag/cache/simple_cache.py index b6af77a06..fea9c79b2 100644 --- a/src/autocoder/rag/cache/simple_cache.py +++ b/src/autocoder/rag/cache/simple_cache.py @@ -313,6 +313,9 @@ def get_all_files(self) -> List[Tuple[str, str, float]]: ): continue + if file.startswith("~$"): + continue + file_path = os.path.join(root, file) relative_path = os.path.relpath(file_path, self.path) modify_time = os.path.getmtime(file_path)