code review agent froze mid-annotation on a minified bundle diff
Fixes a review agent that freezes while annotating a minified bundle diff. Use it when annotation stalls or crawls on generated bundle files with extremely long lines. Key trigger: the agent hangs or slows to a crawl on a .min.js or bundle file during annotation.
TL;DR: Minified bundles are single-line megabyte files that choke line-based annotation. Detect them before annotating (minified suffix, very long lines, generated markers) and skip line-level annotation on them entirely - leave a file-level note instead. The review finishes in seconds instead of freezing on one file.
code review agent froze mid-annotation on a minified bundle diff- Identify the offending file. Check the annotation log for the file it was processing when it froze; it will almost always be a bundle, a minified asset, or a generated file.
Expected: one file with extreme line lengths (tens of thousands of characters per line) in the frozen step.
- Add a pre-annotation filter. Skip line-level annotation for files matching minified or bundle patterns (such as .min.js, .bundle.js, and dist output) and for any file where the average line length exceeds a sane threshold.
Expected: the filter catches the bundle before the annotator ever sees it.
- Also catch generated markers. If the diff header or the file's first lines say the file is generated, treat it the same as a bundle and skip it.
Expected: generated-but-not-minified files (compiled output, lockfiles) are excluded too.
- Replace the skipped annotation with a single file-level note: "generated bundle, not line-reviewed; review the source files instead."
Expected: the review still acknowledges the file without pretending to have read it.
- Make sure the annotator works per line with a cap on line length. If a line exceeds the cap, skip that line rather than trying to process it.
Expected: even an unfiltered long line degrades to a skip, never a freeze.
- Re-run the annotation pass on the same PR.
Expected: the bundle is skipped in milliseconds and the run completes.
Use this when
- Annotation freezes or crawls on a minified or bundle file
- A single generated file dominates review time
- The annotator chokes on extremely long lines
- You want generated assets excluded from line review
Not for this skill when
- The agent runs out of memory on a large but legitimate source diff (that is a chunking problem)
- Annotation fails with an API error rather than freezing (check permissions and rate limits)
- The freeze is on the PR files page load, not during annotation (that is a page-load problem)
- The file is a large hand-written file, not generated (then the fix is per-file caps, not exclusion)
Variant phrasings
- "review bot hangs on minified js diff"
- "annotation stuck on bundle file"
- "agent freezes reviewing dist output"
- "skip generated files in automated code review"
Why it happens
Annotation logic assumes human-shaped code: short lines, one statement per line. A minified bundle inverts that - one line can hold an entire library, so any per-line tokenization, parsing, or model call explodes. The freeze is not a bug in the annotator so much as a file the annotator was never meant to read.
Edge cases
- Some repos commit bundles that humans do review for supply-chain reasons. Make the skip list configurable per repo rather than hardcoded.
- Source maps alongside the bundle are also generated. Exclude them with the same filter.
- A "generated" marker can be faked, but for review-skipping purposes a false positive only costs a file-level note, not correctness.
- If the bundle is the only changed file in the PR, the review will be nearly empty. Say so explicitly so it does not look like the agent malfunctioned.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstRDsKCZcQ6swdXhN8lZrrQ
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.