Skip to content

fix: skip binary/large files in chat repo info capture and disable by default#295253

Merged
zhichli merged 2 commits intomainfrom
frightened-cricket
Feb 13, 2026
Merged

fix: skip binary/large files in chat repo info capture and disable by default#295253
zhichli merged 2 commits intomainfrom
frightened-cricket

Conversation

@zhichli
Copy link
Member

@zhichli zhichli commented Feb 13, 2026

Adjust file size limits to 1 MB and change the default setting for repository information capture to false

Fixes #294863

Copilot AI review requested due to automatic review settings February 13, 2026 21:30
@zhichli zhichli self-assigned this Feb 13, 2026
@zhichli zhichli changed the title chore: update file size limits and adjust repo info configuration default to false fix: skip binary/large files in chat repo info capture and disable by default Feb 13, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 13, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the repository information capture feature's default configuration from true to false and adds file size limits with binary file detection to prevent processing of large or binary files when generating unified diffs for chat sessions.

Changes:

  • Changed the default value of ChatConfiguration.RepoInfoEnabled from true to false in both the configuration registry and the export action
  • Added a 1 MB file size limit (MAX_FILE_SIZE_BYTES) for reading files during diff generation
  • Implemented binary file detection using detectEncodingFromBuffer to skip binary files
  • Enhanced error handling to properly catch and handle FILE_TOO_LARGE errors

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/vs/workbench/contrib/chat/electron-browser/actions/chatExportZip.ts Changed fallback default for repoInfoEnabled from true to false
src/vs/workbench/contrib/chat/browser/chatRepoInfo.ts Added file size limit constant, binary detection, size limit error handling, and changed configuration default to false

@zhichli zhichli enabled auto-merge February 13, 2026 21:34
@zhichli zhichli merged commit b449680 into main Feb 13, 2026
24 checks passed
@zhichli zhichli deleted the frightened-cricket branch February 13, 2026 21:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

VS Code crashes from an out of memory whenever Copilot is asked a question in the VS root repo

2 participants