fix(tools): scope recursive directory ignores to listed root

This commit is contained in:
RaycarlLei authored and Xubin Ren committed 2026-10-03 20:40:37 +08:00
1 parent b0d2382856
commit 8052c3a460
2 files changed
+20 -2

No files matched your search

+2 -2
View File
@@ -1174,11 +1174,11 @@ class ListDirTool(_FsTool):
if recursive:
for item in sorted(dp.rglob("*")):
if any(p in self._IGNORE_DIRS for p in item.parts):
rel = item.relative_to(dp)
if any(p in self._IGNORE_DIRS for p in rel.parts):
continue
total += 1
if len(items) < cap:
rel = item.relative_to(dp)
items.append(f"{rel}/" if item.is_dir() else str(rel))
else:
for item in sorted(dp.iterdir()):