@@ -141,7 +141,7 @@ type ProjectIndexInput = {
141141 readFile ?: ( filePath : string ) => string | null | Promise < string | null >
142142}
143143
144- const DEFAULT_SYMBOL_PARSE_FILE_BYTES = 1_000_000
144+ const MAX_DISCOVERED_PROJECT_READ_BYTES = 1_000_000
145145
146146async function computeProjectIndex ( params : ProjectIndexInput ) : Promise < {
147147 fileTree : FileTreeNode [ ]
@@ -205,13 +205,12 @@ function createDiscoveredProjectReader(params: {
205205 logger : Logger
206206} ) : ( filePath : string ) => Promise < string | null > {
207207 const { cwd, fs, logger } = params
208- const maxBytes = getSymbolParseFileByteLimit ( )
209208
210209 return async ( filePath : string ) => {
211210 const fullPath = path . join ( cwd , filePath )
212211 try {
213212 const stats = await fs . stat ( fullPath )
214- if ( getFileSize ( stats ) > maxBytes ) {
213+ if ( getFileSize ( stats ) > MAX_DISCOVERED_PROJECT_READ_BYTES ) {
215214 return null
216215 }
217216 return await fs . readFile ( fullPath , 'utf8' )
@@ -229,16 +228,6 @@ function getFileSize(stats: Awaited<ReturnType<CodebuffFileSystem['stat']>>) {
229228 return typeof stats . size === 'number' ? stats . size : 0
230229}
231230
232- function getSymbolParseFileByteLimit ( ) {
233- const raw = process . env . CODEBUFF_MAX_PARSE_FILE_BYTES
234- if ( ! raw ) return DEFAULT_SYMBOL_PARSE_FILE_BYTES
235-
236- const parsed = Number . parseInt ( raw , 10 )
237- return Number . isFinite ( parsed ) && parsed > 0
238- ? parsed
239- : DEFAULT_SYMBOL_PARSE_FILE_BYTES
240- }
241-
242231/**
243232 * Helper to convert ChildProcess to Promise with stdout/stderr
244233 */
0 commit comments