diff --git a/src/review/review-grounding.ts b/src/review/review-grounding.ts index 378efaafec..b3a530c5a4 100644 --- a/src/review/review-grounding.ts +++ b/src/review/review-grounding.ts @@ -51,7 +51,7 @@ export interface ReviewGrounding { const FILE_CONTENT_BUDGET = 60_000; // total chars inlined across all changed files const MAX_SINGLE_FILE = 24_000; // a file larger than this is marked truncated (review it from the diff) // Binary / generated / lockfile paths carry no review signal as full text — skip inlining them. -const SKIP_EXT = /\.(png|jpe?g|gif|webp|avif|bmp|heic|svg|ico|pdf|lock|min\.js|min\.css|map|woff2?|ttf|eot|mp4|webm|zip|gz|tgz|wasm)$/i; +const SKIP_EXT = /\.(png|jpe?g|gif|webp|avif|bmp|heic|svg|ico|pdf|lock|min\.js|min\.css|map|woff2?|ttf|eot|mp4|webm|zip|gz|tgz|wasm|class|jar|pyc|pyo)$/i; /** The grounding feature flags (subset of reviewbot's FeatureToggles). */ export interface GroundingFlags { diff --git a/test/unit/review-grounding.test.ts b/test/unit/review-grounding.test.ts index 14b7ec8d8d..afa243647d 100644 --- a/test/unit/review-grounding.test.ts +++ b/test/unit/review-grounding.test.ts @@ -161,7 +161,17 @@ describe("review-grounding: fetchFullFileContents (injected FileFetcher, fail-sa return "SHOULD_NOT_FETCH"; }, }; - const binary = ["logo.png", "assets/photo.avif", "assets/poster.bmp", "assets/icon.heic", "dist/pkg.tgz"]; + const binary = [ + "logo.png", + "assets/photo.avif", + "assets/poster.bmp", + "assets/icon.heic", + "dist/pkg.tgz", + "build/App.class", + "lib/service.jar", + "__pycache__/mod.pyc", + "gen/stub.pyo", + ]; const out = await fetchFullFileContents( { ciGrounding: false, fullFileContext: true }, "sha", @@ -173,6 +183,10 @@ describe("review-grounding: fetchFullFileContents (injected FileFetcher, fail-sa ["assets/poster.bmp"], ["assets/icon.heic"], ["dist/pkg.tgz"], + ["build/App.class"], + ["lib/service.jar"], + ["__pycache__/mod.pyc"], + ["gen/stub.pyo"], ["old.ts", "removed"], ), fetcher,