Repository navigation
fix(core): add missing binary file extensions to ignore patterns - #22793
elliotllliu wants to merge 1 commit into
Conversation
Add game engine archives (.pak, .rpa, .unity3d, .asset, .bundle), disk images (.iso, .dmg, .msi, .deb, .rpm, .apk), additional archive formats (.xz, .zst, .lz4, .cab), Electron (.asar), and Python distribution (.whl, .egg) to BINARY_FILE_PATTERNS. This prevents the CLI from including large binary files in the context bundle, which could cause context size to inflate to hundreds of megabytes and result in silent timeouts. Fixes google-gemini#22565
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses a critical performance issue in the Gemini CLI where large binary files were inadvertently included in the context bundle, leading to silent timeouts. By significantly expanding the list of ignored binary file extensions, the change ensures that the CLI processes only relevant code, thereby improving efficiency and preventing hangs when operating in directories containing such files. Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request addresses an issue where the CLI would hang when processing large binary files by adding a comprehensive list of binary file extensions to the ignore patterns. The added extensions cover game engine archives, disk images, installers, and other common binary formats. This change is a direct and effective fix for the reported problem. The implementation is correct and follows the existing code style. I have no high or critical severity issues to report.
|
I signed it! |
|
Hi there! Thank you for your interest in contributing to Gemini CLI. To ensure we maintain high code quality and focus on our prioritized roadmap, we have updated our contribution policy (see Discussion #17383). We only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. All other community pull requests are subject to closure after 14 days if they do not align with our current focus areas. For this reason, we strongly recommend that contributors only submit pull requests against issues explicitly labeled as 'help-wanted'. This pull request is being closed as it has been open for 14 days without a 'help wanted' designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding and for being part of our community! |
|
@elliotllliu, apologies for the bot closing this PR! We have reopened it. Please sync your branch to the latest |
spencer426
left a comment
There was a problem hiding this comment.
Thanks for this contribution! The logic changes are solid and correctly fix the issue with large binary files inflating the context size.
Before we can get this merged, there is one required step and one minor improvement requested:
Required:
- CLA: The
cla/googlestatus check is currently failing. Please sign the Google Contributor License Agreement (CLA) using the link provided in the failing check. We cannot merge the PR until this is completed.
Once the CLA is signed and (optionally) the tests are updated, we can get this merged!
| '**/*.ods', | ||
| '**/*.odp', | ||
| // Game engine and large archive formats | ||
| '**/*.pak', |
There was a problem hiding this comment.
Improvement (Minor):
Please update the BINARY_EXTENSIONS tests in packages/core/src/utils/ignorePatterns.test.ts to cover your new extensions. There is an it.each block that tests categories like "common binary file extensions" and "media file extensions". It would be great to add the new categories (e.g., "game engine and large archive formats", "disk images and installers", "python distribution") with a few of the newly added extensions to ensure they aren't accidentally removed in the future.
|
Thank you for your interest in contributing to the project! We are closing this PR due to inactivity. |
Summary
Adds missing binary file extensions to
BINARY_FILE_PATTERNSinignorePatterns.tsto prevent the CLI from including large binary files in the context bundle.Details
When running Gemini CLI in directories containing large game modding and archive binaries (e.g.,
.pakUnreal Engine archives,.rpaRen'Py archives), the CLI fails to filter them out. This causes the context size to inflate to 192+ MB, resulting in silent timeouts (15+ minutes) without any error message.The fix adds the following extension categories to
BINARY_FILE_PATTERNS:.pak,.rpa,.unity3d,.asset,.bundle.iso,.dmg,.msi,.deb,.rpm,.apk.xz,.zst,.lz4,.cab.asar.whl,.eggRelated Issues
Fixes #22565
How to Validate
.pakor.rpafiles (or any of the newly added extensions)Pre-Merge Checklist