mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 03:24:42 -07:00
fix(cli): prevent OOM crash by limiting file search traversal and adding timeout (#16696)
This commit is contained in:
@@ -24,6 +24,7 @@ export interface FileSearchOptions {
|
||||
enableRecursiveFileSearch: boolean;
|
||||
disableFuzzySearch: boolean;
|
||||
maxDepth?: number;
|
||||
maxFiles?: number;
|
||||
}
|
||||
|
||||
export class AbortError extends Error {
|
||||
@@ -109,7 +110,9 @@ class RecursiveFileSearch implements FileSearch {
|
||||
cache: this.options.cache,
|
||||
cacheTtl: this.options.cacheTtl,
|
||||
maxDepth: this.options.maxDepth,
|
||||
maxFiles: this.options.maxFiles ?? 20000,
|
||||
});
|
||||
|
||||
this.buildResultCache();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user