feat(extraction): make MAX_FILE_SIZE configurable via CODEGRAPH_MAX_FILE_SIZE env var#1224
Open
fengshao1227 wants to merge 1 commit into
Open
Conversation
…ILE_SIZE env var (colbymchenry#1016) Projects with legitimate large source files (1-5 MB, not minified/vendored) were silently skipped during indexing, leaving gaps in the function graph. The 1 MB default is unchanged. Users can override it via the CODEGRAPH_MAX_FILE_SIZE environment variable (value in bytes): CODEGRAPH_MAX_FILE_SIZE=5242880 codegraph index Invalid values (non-numeric, zero, negative) fall back to the 1 MB default. Closes colbymchenry#1016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Projects with legitimate large source files (1–5 MB hand-written code, not minified bundles or vendored blobs) are silently skipped during indexing due to the hardcoded 1 MB file size limit. This leaves gaps in the function graph.
This PR makes the limit configurable via the
CODEGRAPH_MAX_FILE_SIZEenvironment variable (value in bytes), following the existing pattern ofCODEGRAPH_*env vars for runtime configuration:CODEGRAPH_MAX_FILE_SIZE=5242880 codegraph index # 5 MB limitThe 1 MB default is unchanged — zero behavior difference for users who don't set the variable.
size_exceededwarning message already includes the effective limit, so users can see the configured valuegetMaxFileSize()function enables testing and future use bycodegraph statusCloses #1016
Test plan
extraction.test.ts: