diff options
| author | Brandon Keiji <[email protected]> | 2025-07-23 14:48:35 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-23 21:48:35 +0000 |
| commit | d7a304bcffc7d2340f3de762f14286596954ce4e (patch) | |
| tree | 6625f9cf3f3c560a595f2f232292c22499276660 /packages/core/src/utils/memoryDiscovery.ts | |
| parent | 9d3164621a8bb0e2bbf8d2309fba1d8678c0abe2 (diff) | |
feat(memory): make directory search limit on memory discovery configurable with settings.json (#4460)
Diffstat (limited to 'packages/core/src/utils/memoryDiscovery.ts')
| -rw-r--r-- | packages/core/src/utils/memoryDiscovery.ts | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/packages/core/src/utils/memoryDiscovery.ts b/packages/core/src/utils/memoryDiscovery.ts index 33231823..88c82373 100644 --- a/packages/core/src/utils/memoryDiscovery.ts +++ b/packages/core/src/utils/memoryDiscovery.ts @@ -33,8 +33,6 @@ const logger = { console.error('[ERROR] [MemoryDiscovery]', ...args), }; -const MAX_DIRECTORIES_TO_SCAN_FOR_MEMORY = 200; - interface GeminiFileContent { filePath: string; content: string | null; @@ -90,6 +88,7 @@ async function getGeminiMdFilePathsInternal( fileService: FileDiscoveryService, extensionContextFilePaths: string[] = [], fileFilteringOptions: FileFilteringOptions, + maxDirs: number, ): Promise<string[]> { const allPaths = new Set<string>(); const geminiMdFilenames = getAllGeminiMdFilenames(); @@ -194,7 +193,7 @@ async function getGeminiMdFilePathsInternal( const downwardPaths = await bfsFileSearch(resolvedCwd, { fileName: geminiMdFilename, - maxDirs: MAX_DIRECTORIES_TO_SCAN_FOR_MEMORY, + maxDirs, debug: debugMode, fileService, fileFilteringOptions: mergedOptions, // Pass merged options as fileFilter @@ -295,6 +294,7 @@ export async function loadServerHierarchicalMemory( fileService: FileDiscoveryService, extensionContextFilePaths: string[] = [], fileFilteringOptions?: FileFilteringOptions, + maxDirs: number = 200, ): Promise<{ memoryContent: string; fileCount: number }> { if (debugMode) logger.debug( @@ -311,6 +311,7 @@ export async function loadServerHierarchicalMemory( fileService, extensionContextFilePaths, fileFilteringOptions || DEFAULT_MEMORY_FILE_FILTERING_OPTIONS, + maxDirs, ); if (filePaths.length === 0) { if (debugMode) logger.debug('No GEMINI.md files found in hierarchy.'); |
