feat(config): seed root symlink mappings before deep scanning

Add `_seed_root_symlink_mappings` method to ensure symlinked root folders are recorded before deep scanning, preventing them from being missed during directory traversal. This ensures that root symlinks are properly captured in the path mappings.

Additionally, normalize separators in relative paths for cross-platform consistency in `BaseModelService`, and update tests to verify root symlinks are preserved in the cache.
This commit is contained in:
Will Miao
2025-12-16 22:05:40 +08:00
parent 3382d83aee
commit 099a71b2cc
3 changed files with 57 additions and 0 deletions

View File

@@ -716,6 +716,8 @@ class BaseModelService(ABC):
if normalized_file.startswith(normalized_root):
# Remove root and leading separator to get relative path
relative_path = normalized_file[len(normalized_root):].lstrip(os.sep)
# Normalize separators so results are stable across platforms
relative_path = relative_path.replace(os.sep, "/")
break
if not relative_path: