-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Add clarity to error messages #14879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary of ChangesHello @gsehgal, 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 significantly improves the clarity of error messages within the Gemini CLI, particularly for 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 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.
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 improves error reporting by propagating detailed error messages from handleAtCommand to the non-interactive CLI. The changes are logical and include a new test case to validate the error handling for user-cancelled operations. The implementation correctly modifies handleAtCommand to return an error string and updates runNonInteractive to use it, leading to more informative error messages for the user. I've identified a minor logical issue where a code path is unreachable, which could be simplified for better clarity and maintainability.
scidomino
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused. Why are we returning an error message instead of throwing an error?
LIHUA919
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The cognitive load of this logic block is quite high. Even though it works, the implementation obscures the business intent. For long-term maintainability, could we refactor this to be more explicit? Simplicity is better than complexity.
|
@LIHUA919 do mean to refactor the entire function, can you explicitly state which block of code you are referring to ? |
LIHUA919
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great job!
@LIHUA919 if you find some part of the code difficult to understand try out codewiki.google It is LLM powered documentation of public repositories |
Summary
Add clarity to the error messages return by gemini cli
Details
Current the handleAtCommand does not return a error message; it just returns a boolean flag in case of error, because of which the error messages sent back to user are very generic. In this PR we have added error message to the handleAtCommand ; to make sure the correct error messages are sent back to user.
Related Issues
google-github-actions/run-gemini-cli#266
How to Validate
Refer to bug to to re-produce and fix the issue.
Pre-Merge Checklist