Repository navigation
Fix/auth url wrapping - #29460
Fix/auth url wrapping#29460anshumancodes wants to merge 6 commits into
Conversation
Signed-off-by: anshumancodes <[email protected]>
Signed-off-by: anshumancodes <[email protected]>
Signed-off-by: anshumancodes <[email protected]>
Signed-off-by: anshumancodes <[email protected]>
|
📊 PR Size: size/M
|
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 usability issue where long OAuth URLs displayed in the CLI were being truncated by terminal word-wrapping, leading to authentication failures. By implementing OSC 8 terminal hyperlink sequences, the full URL is now preserved as a single clickable entity, ensuring that the entire query string is correctly passed to the browser regardless of terminal width. 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 introduces OSC 8 terminal hyperlink escape sequences to wrap bare URLs in both the markdown parsing utility and the OAuth2 authorization flow, ensuring that full URLs remain clickable in terminal environments. The review feedback highlights two important issues: first, a potential terminal spoofing vulnerability in markdownParsingUtils.ts where raw, unsanitized URLs are interpolated into escape sequences, which should be mitigated by sanitizing control characters and checking for color support; second, the risk of printing raw escape sequences in non-TTY or color-disabled environments in oauth2.ts, which can be resolved by checking process.stdout.isTTY and NO_COLOR before outputting OSC 8 sequences.
Signed-off-by: anshumancodes <[email protected]>
Signed-off-by: anshumancodes <[email protected]>
|
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
Fixes an issue where long Google OAuth URLs could be truncated when wrapped by the terminal, causing authentication to fail with
Error 400: invalid_request.The OAuth URLs are now rendered using OSC 8 terminal hyperlinks so the complete URL remains intact even when the visible URL wraps across terminal lines.
Details
redirect_uri,response_type, andclient_id, as the hyperlink target.Related Issues
Fixes #29430
issue 29430
How to Validate
Start the Google authentication flow.
Use a narrow terminal width so that the OAuth URL wraps across multiple lines.
Click the displayed OAuth URL.
Verify that the browser receives the complete OAuth URL, including parameters such as
redirect_uri,response_type, andclient_id, rather than only the first wrapped line.Run the relevant tests:
npm testPre-Merge Checklist
Updated relevant documentation and README (if needed)
Added/updated tests (if needed)
Noted breaking changes (if any)
Validated on required platforms/methods:
MacOS
Windows
Linux