fix(file-tree): bound recursive project traversal - #1083
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughFile-tree traversal now enforces a shared 10,000-entry limit, processes recursive branches sequentially, and raises ChangesFile-tree entry budget
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Fixes #1082.
Follow-up to #1074, which prevents recursion into forbidden system paths but intentionally leaves ordinary large project roots for a separate change.
Problem
buildFileTreewalks project roots to depth 10 with no total node budget. Its recursivePromise.allstructure creates and retains the pending work and completed subtrees until the root resolves. A broad but valid root such as a populated home directory can therefore consume several gigabytes of heap, starve other API requests, and eventually crash-loop the server.Fix
FILE_TREE_TOO_LARGEerror that tells users to choose a narrower root or add ignore rules.The limit is checked after ignore filtering, so generated directories and
.gitignoreexclusions do not consume the budget.Verification
npx tsx --tsconfig server/tsconfig.json --test server/modules/file-tree/tests/file-tree.service.test.ts server/modules/file-tree/tests/file-tree.routes.test.ts— 11 passednpm run build— passednpm run typecheck— passednpm run lint— passed with 0 errors; existing repository warnings remainSummary by CodeRabbit