Refactor grep tool output generation and fix ls directory traversal bug

🤖 Generated with opencode
Co-Authored-By: opencode <noreply@opencode.ai>
This commit is contained in:
Dax Raad
2025-05-27 02:26:53 -04:00
parent c040baae11
commit 98b5390a22
3 changed files with 55 additions and 29 deletions

View File

@@ -125,12 +125,11 @@ async function listDirectory(
results.push(fullPath + path.sep);
}
if (results.length < limit) {
await walk(fullPath);
} else {
if (results.length >= limit) {
truncated = true;
return;
}
await walk(fullPath);
} else if (entry.isFile()) {
if (fullPath !== initialPath) {
results.push(fullPath);