Conversation
Adds refreshTokenTtl and refreshTokenScopes config options to control refresh token behavior. By default, refresh tokens are always issued (empty refreshTokenScopes) with a 30-day TTL, matching Linear's MCP server behavior. This improves UX for Claude Code users since tokens can now be silently refreshed instead of requiring re-authentication. Also consolidates TTL defaults into config unmarshaling (single source of truth) and removes unused NewSession helper with hardcoded TTLs.
Summary of ChangesHello @dgellow, 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 enhances the authentication system by introducing configurable refresh token behavior. The primary goal is to improve the user experience by allowing client applications to silently refresh authentication tokens, thereby minimizing disruptive re-authentication prompts. This is achieved through new configuration options for refresh token lifespan and scopes, alongside a refactoring effort to centralize default TTL values and remove redundant code. 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. 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 introduces configurable refresh token TTL and scopes, which is a great improvement for user experience by allowing silent token refreshes. The changes are well-implemented, centralizing TTL defaults into the config unmarshaling process and removing unused code. My review includes one suggestion to improve maintainability by replacing a magic number for the default refresh token TTL with a constant.
| } | ||
| o.RefreshTokenTTL = refreshTokenTTL | ||
| } else { | ||
| o.RefreshTokenTTL = 30 * 24 * time.Hour // Default: 30 days |
There was a problem hiding this comment.
The magic number 30 * 24 * time.Hour is used as the default RefreshTokenTTL here and is also repeated in several test files (load_test.go, provider_test.go, auth_handlers_test.go, http_test.go). To improve maintainability and ensure consistency, consider defining this value as a constant in a central place, for example, as DefaultRefreshTokenTTL in the internal/config package. This would provide a single source of truth for this default value.
Adds refreshTokenTtl and refreshTokenScopes config options to control refresh token behavior. By default, refresh tokens are always issued (empty refreshTokenScopes) with a 30-day TTL, matching Linear's MCP server behavior. This improves UX for Claude Code users since tokens can now be silently refreshed instead of requiring re-authentication.
Also consolidates TTL defaults into config unmarshaling (single source of truth) and removes unused NewSession helper with hardcoded TTLs.