fix: preserve refresh token when server omits it from refresh response#1
fix: preserve refresh token when server omits it from refresh response#1
Conversation
When refreshing OAuth tokens, if the server doesn't return a new refresh_token (standard OAuth2 behavior), preserve the existing one instead of overwriting with undefined. Also adds test infrastructure: - 17 tests covering token refresh, headers, tool prefixing, sanitization - CI workflow for running tests on push/PR
Summary of ChangesHello @elijahr, 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 critical bug where the OAuth refresh token could be inadvertently discarded if the authentication server did not explicitly return it during a token refresh operation. Beyond this crucial fix, the PR significantly enhances the project's test coverage by introducing a detailed suite of unit tests. These tests validate various aspects of the Anthropic authentication plugin, including its token management, how it modifies API requests (e.g., headers, tool names), and its handling of system prompts. The integration of Bun for testing further streamlines the development workflow. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Ignored Files
Activity
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.
Code Review
This pull request correctly addresses an issue where the refresh token was not preserved if the server's refresh response omitted it. The change in index.mjs using the nullish coalescing operator is concise and effective. I'm particularly impressed with the addition of index.test.mjs, which provides a comprehensive suite of tests covering not only the fix but also various other aspects of the plugin's functionality. The new tests are well-structured and cover positive, negative, and edge cases for token refreshing. The updates to package.json and bun.lock are also appropriate. Overall, this is a high-quality contribution.
Test PR to verify CI runs. See upstream PR: anomalyco#47