Description
The read-many-files tool processes all matched files concurrently without any concurrency limits.
// packages/core/src/tools/read-many-files.ts
// No concurrency limit
const results = await Promise.allSettled(fileProcessingPromises);
Impact
- Crashes with
EMFILE: too many open files on large directories (e.g., node_modules)
- Potential denial of service due to OS file descriptor exhaustion
- Unable to scan full project trees reliably
Potential Fix
Introduce a concurrency limit using a p-limit wrapper (e.g., max 20 concurrent operations) to respect OS limits.
Description
The
read-many-filestool processes all matched files concurrently without any concurrency limits.Impact
EMFILE: too many open fileson large directories (e.g.,node_modules)Potential Fix
Introduce a concurrency limit using a
p-limitwrapper (e.g., max 20 concurrent operations) to respect OS limits.