Built-in common binary extension denylist — skip these in getFilesDiff / getBranchDiff:
.png, .jpg, .jpeg, .gif, .ico, .svg, .webp, .bmp, .tiff, .mp4, .avi, .mov, .wmv, .flv, .mkv, .mp3, .wav, .flac, .ogg, .aac, .wma, .zip, .tar, .gz, .7z, .rar, .exe, .dll, .so, .dylib, .wasm, .pdf, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .ttf, .otf, .woff, .woff2, .eot, .pyc, .class, .o, .a, .lib, .obj
Description
getFileDiff(),getFilesDiff(), andgetBranchDiff()insrc/gitService.tsdo not filter out binary files before feeding diff into AI generation. While Git outputs a shortBinary files differsummary for known binary extensions, several scenarios still cause problems:.whl,.blend,.bin, etc.) may be treated as text by Git, producing garbled binary content in the diff outputBinary files differline wastes token budget when many binary files are modified.gitattributesis provided or detected at project levelgeneratePrContent,generateCommitMessage,generatePrDescription) depend on diff fromgetFilesDiff/getBranchDiff— garbage binary content consumes context window and can cause AI calls to exceed token limitsAffected Code
src/gitService.ts—getFileDiff()(line 293),getFilesDiff()(line 788),getBranchDiff()(line 720)src/aiService.ts— all generation functions consume diff outputsrc/inputService.ts— passes diff to AI without pre-filteringSuggested Solution
Built-in common binary extension denylist — skip these in
getFilesDiff/getBranchDiff:.png,.jpg,.jpeg,.gif,.ico,.svg,.webp,.bmp,.tiff,.mp4,.avi,.mov,.wmv,.flv,.mkv,.mp3,.wav,.flac,.ogg,.aac,.wma,.zip,.tar,.gz,.7z,.rar,.exe,.dll,.so,.dylib,.wasm,.pdf,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.ttf,.otf,.woff,.woff2,.eot,.pyc,.class,.o,.a,.lib,.objDetect binary content in diff output — check if the diff contains
Binary filesorGIT binary patchheaders and skip those entriesOptionally generate a default
.gitattributeswith common binary patterns, or prompt users to set one upFilter at diff collection entry points (
getFilesDiff/getBranchDiff) so downstream callers don't need to worry about itNo implementation required for this issue — design discussion and solution architecture only.