fix(auth): don't crash when initial auth fails#17308
Conversation
Summary of ChangesHello @skeshive, 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 enhances the robustness of the Gemini CLI by refactoring its initial authentication error handling. The change ensures that the application no longer terminates abruptly upon an authentication failure, thereby improving the user experience by allowing the interface to remain active and inform the user of the issue gracefully. 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
|
|
Size Change: +106 B (0%) Total Size: 23.2 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Code Review
This pull request aims to prevent the CLI from crashing on initial authentication failure. While the intent is good, the current implementation in non-interactive mode can lead to incorrect behavior by allowing the process to continue and potentially exit with a success code even after an auth failure. I've suggested a change to ensure that authentication errors are always handled as fatal errors, while still allowing for proper error formatting (e.g., as JSON).
|
/patch |
|
✅ Patch workflow(s) dispatched successfully! 📋 Details:
🔗 Track Progress: |
# Conflicts: # packages/cli/src/gemini.tsx
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
# Conflicts: # packages/cli/src/gemini.tsx
|
🚀 Patch PR Created! 📋 Patch Details:
📝 Next Steps:
🔗 Track Progress: |
|
🚀 Patch Release Started! 📋 Release Details:
⏳ Status: The patch release is now running. You'll receive another update when it completes. 🔗 Track Progress: |
|
🚀 Patch Release Started! 📋 Release Details:
⏳ Status: The patch release is now running. You'll receive another update when it completes. 🔗 Track Progress: |
|
✅ Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
|
✅ Patch Release Complete! 📦 Release Details:
🎉 Status: Your patch has been successfully released and published to npm! 📝 What's Available:
🔗 Links: |
TLDR
This change prevents Gemini CLI from crashing if the initial authentication fails at startup. Instead of exiting the process, the application will now continue to run, allowing the UI to display an appropriate error message / the user to switch auth types.
Linked Issues
Fixes #17300, Fixes #17225