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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user