Repository navigation
Conversation
|
📊 PR Size: size/L
|
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 stability issue where the Gemini CLI would crash upon startup when running inside a Git repository within restricted environments, such as macOS Seatbelt. By adding an error listener to the file watcher responsible for monitoring Git branch changes, the application now gracefully logs these errors instead of encountering an unhandled exception that terminates the process. Highlights
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 the 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 counterproductive. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request cleans up unused test dependencies from packages/a2a-server and packages/sdk in package-lock.json. It also improves the useGitBranchName hook in packages/cli by adding error handling to the file watcher and introduces a unit test to verify this behavior. Feedback is provided to ensure the watcher instance is checked for existence before accessing its properties to prevent potential runtime crashes in environments where it might be undefined.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
|
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 only guarantee review and consideration of pull requests for issues that are explicitly labeled as 'help wanted'. This PR will be closed in 7 days if it remains without that designation. We encourage you to find and contribute to existing 'help wanted' issues in our backlog! Thank you for your understanding. |
|
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. |
Summary
Prevent Gemini CLI from crashing on startup when run inside a Git repository under macOS Seatbelt or other restricted permissions environments.
Details
When Gemini CLI starts up, the
useGitBranchNamehook is mounted to retrieve and display the active Git branch. If a.gitfolder is present, it initializes a Node.jsfs.watchfile watcher on the.gitdirectory to monitor changes.In environments with restricted sandbox permissions (like macOS Seatbelt), the file watcher can fail/emit an asynchronous
'error'event. Because Node'sFSWatcherlacked an'error'event listener, this unhandled'error'event terminated the Node process immediately.This PR adds a graceful listener to
'error'events on the watcher to suppress/log them without crashing the entire CLI. It also safely guards the registration withtypeof w.on === 'function'to avoid breaking existing testing mocks.Related Issues
Fixes #29153
How to Validate
useGitBranchNameand verify all 8 tests pass (including our newly added error suppression test):Pre-Merge Checklist