Skip to content

Conversation

@jdalton
Copy link
Contributor

@jdalton jdalton commented Jan 12, 2026

Summary

  • Prevent heap overflow in large monorepo scans by using streaming-based filtering

Changes

  • Added createSupportedFilesFilter() function to create filter functions from supported file patterns
  • Added filter option to GlobWithGitIgnoreOptions for streaming-based filtering
  • Modified globWithGitIgnore() to apply filter during streaming instead of accumulating all files first
  • Updated getPackageFilesForScan() to use streaming filter to avoid OOM errors in large monorepos (100k+ files)

Test plan

  • Test scanning large monorepos with 100k+ files
  • Verify memory usage remains stable during scans
  • Ensure file filtering still works correctly

🤖 Generated with Claude Code


Note

Implements streaming-based file filtering to reduce memory usage during scans and updates dependencies.

  • Adds filter option to globWithGitIgnore() and applies it during stream processing (supports negated gitignore patterns)
  • Introduces createSupportedFilesFilter() and uses it in getPackageFilesForScan() to filter supported files early
  • Keeps existing fast path when no negations or filter are present
  • Updates external-tools.json to @coana-tech/cli@14.12.148
  • Updates CHANGELOG.md with Unreleased notes for the fix

Written by Cursor Bugbot for commit 3712e70. Configure here.

jdalton and others added 2 commits January 12, 2026 12:28
Update @coana-tech/cli from v14.12.139 to v14.12.148.

Ported from v1.x commits:
- b66490a: bump coana version (#1017) - 14.12.143
- f91f262: upgrade Coana (#1024) - 14.12.148
Add streaming-based filtering to globWithGitIgnore to prevent heap overflow
when scanning large monorepos with 100k+ files. Instead of accumulating all
file paths and filtering afterwards, files are now filtered during streaming
which dramatically reduces memory usage.

Changes:
- Add `filter` option to globWithGitIgnore for early filtering during streaming
- Add createSupportedFilesFilter helper to create filter from supported files
- Update getPackageFilesForScan to use streaming filter

Fixes SMO-522

Ported from v1.x commit 9bbb8e8 ([SMO-522] Fix heap overflow in large monorepo scans #1026)

Co-authored-by: Mikola Lysenko <mikolalysenko@gmail.com>
@jdalton jdalton closed this Jan 12, 2026
@jdalton jdalton deleted the fix/heap-overflow-monorepo-scans branch January 12, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants