Skip to content

fix(core): add missing binary file extensions to ignore patterns - #22793

Closed
elliotllliu wants to merge 1 commit into
google-gemini:mainfrom
elliotllliu:fix/add-missing-binary-extensions
Closed

elliotllliu wants to merge 1 commit into
google-gemini:mainfrom
elliotllliu:fix/add-missing-binary-extensions

Conversation

@elliotllliu

@elliotllliu elliotllliu commented Mar 17, 2026 •

Copy link
Copy Markdown

Summary

Adds missing binary file extensions to BINARY_FILE_PATTERNS in ignorePatterns.ts to 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., .pak Unreal Engine archives, .rpa Ren'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:

  • Game engine archives: .pak, .rpa, .unity3d, .asset, .bundle
  • Disk images & installers: .iso, .dmg, .msi, .deb, .rpm, .apk
  • Additional archive formats: .xz, .zst, .lz4, .cab
  • Electron: .asar
  • Python distribution: .whl, .egg

Related Issues

Fixes #22565

How to Validate

  1. Create a directory with large .pak or .rpa files (or any of the newly added extensions)
  2. Run Gemini CLI in that directory
  3. Verify the context size in the status bar does not include these binary files
  4. Verify the CLI does not hang or timeout

Pre-Merge Checklist

  • Updated relevant documentation and README (if needed)
  • Added/updated tests (if needed)
  • Noted breaking changes (if any): None
  • Validated on required platforms/methods:
    • MacOS
    • Linux

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
@elliotllliu
elliotllliu requested a review from a team as a code owner March 17, 2026 14:44
@google-cla

google-cla Bot commented Mar 17, 2026

Copy link
Copy Markdown

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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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

  • Prevented CLI timeouts: Added numerous binary file extensions to BINARY_FILE_PATTERNS to prevent the Gemini CLI from including large binary files in its context bundle, which previously led to silent timeouts.
  • Expanded ignored file types: Included categories such as game engine archives (.pak, .rpa), disk images (.iso, .dmg), additional archive formats (.xz, .zst), Electron-specific (.asar), and Python distribution files (.whl, .egg).
Changelog
  • packages/core/src/utils/ignorePatterns.ts
    • Added new binary file extensions to BINARY_FILE_PATTERNS.
Activity
  • No specific activity (comments, reviews, progress) was provided in the context.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gemini-cli gemini-cli Bot added the area/core Issues related to User Interface, OS Support, Core Functionality label Mar 17, 2026
@elliotllliu

Copy link
Copy Markdown
Author

I signed it!

@gemini-cli

gemini-cli Bot commented Apr 1, 2026

Copy link
Copy Markdown
Contributor

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!

@cocosheng-g

Copy link
Copy Markdown
Contributor

@elliotllliu, apologies for the bot closing this PR! We have reopened it. Please sync your branch to the latest main and we will have someone review it shortly.

@gemini-cli gemini-cli Bot added the help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! label Apr 8, 2026

@spencer426 spencer426 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/google status 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',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@spencer426 spencer426 closed this Apr 30, 2026
@spencer426 spencer426 reopened this Apr 30, 2026
@spencer426

Copy link
Copy Markdown
Contributor

Thank you for your interest in contributing to the project! We are closing this PR due to inactivity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/core Issues related to User Interface, OS Support, Core Functionality help wanted We will accept PRs from all issues marked as "help wanted". Thanks for your support! size/s A small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI fails to ignore large binary files (.pak, .rpa), causing 192MB+ context bloat and silent timeouts

4 participants