Skip to content

Commit 128f45d

Browse files
committed
feat: increase file limit for code indexing and create dedicated constant
- Rename MAX_LIST_FILES_LIMIT to MAX_LIST_FILES_LIMIT_CODE_INDEX for clarity - Increase limit from 3,000 to 50,000 files to handle larger codebases - This complements the memory leak fixes by allowing proper scanning of enterprise projects
1 parent 13ad9cb commit 128f45d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/services/code-index/constants/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const QDRANT_CODE_BLOCK_NAMESPACE = "f47ac10b-58cc-4372-a567-0e02b2c3d479
1515
export const MAX_FILE_SIZE_BYTES = 1 * 1024 * 1024 // 1MB
1616

1717
/**Directory Scanner */
18-
export const MAX_LIST_FILES_LIMIT = 3_000
18+
export const MAX_LIST_FILES_LIMIT_CODE_INDEX = 50_000
1919
export const BATCH_SEGMENT_THRESHOLD = 60 // Number of code segments to batch for embeddings/upserts
2020
export const MAX_BATCH_RETRIES = 3
2121
export const INITIAL_RETRY_DELAY_MS = 500

src/services/code-index/processors/scanner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { t } from "../../../i18n"
1717
import {
1818
QDRANT_CODE_BLOCK_NAMESPACE,
1919
MAX_FILE_SIZE_BYTES,
20-
MAX_LIST_FILES_LIMIT,
20+
MAX_LIST_FILES_LIMIT_CODE_INDEX,
2121
BATCH_SEGMENT_THRESHOLD,
2222
MAX_BATCH_RETRIES,
2323
INITIAL_RETRY_DELAY_MS,
@@ -57,7 +57,7 @@ export class DirectoryScanner implements IDirectoryScanner {
5757
const scanWorkspace = getWorkspacePathForContext(directoryPath)
5858

5959
// Get all files recursively (handles .gitignore automatically)
60-
const [allPaths, _] = await listFiles(directoryPath, true, MAX_LIST_FILES_LIMIT)
60+
const [allPaths, _] = await listFiles(directoryPath, true, MAX_LIST_FILES_LIMIT_CODE_INDEX)
6161

6262
// Filter out directories (marked with trailing '/')
6363
const filePaths = allPaths.filter((p) => !p.endsWith("/"))

0 commit comments

Comments
 (0)