Skip to content

Conversation

@gsquared94
Copy link
Contributor

@gsquared94 gsquared94 commented Jan 26, 2026

Incorrect refactoring in #17357 causes ignoring eligible tier when some other tier is ineligible which is a regression from current behavior.

Fixes #17582

@gsquared94 gsquared94 requested a review from galz10 January 26, 2026 21:12
@gsquared94 gsquared94 requested a review from a team as a code owner January 26, 2026 21:12
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @gsquared94, 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 regression that caused the system to incorrectly block unlicensed users from accessing code assist features if any tier was marked as ineligible, even if other eligible tiers were available. The fix reintroduces the correct behavior by ensuring that the presence of allowedTiers takes precedence over ineligibleTiers, allowing the user flow to proceed as intended. This improves the user experience for unlicensed users by correctly evaluating their eligibility.

Highlights

  • Prioritize Allowed Tiers: The system now correctly prioritizes allowedTiers from the LoadCodeAssistResponse. If allowedTiers are present, the process continues, even if some ineligibleTiers are also returned.
  • Regression Fix: This change resolves a regression introduced in PR Improve error messages on failed onboarding #17357, which incorrectly caused the system to throw an error when eligible tiers existed alongside ineligible ones for unlicensed users.
  • Enhanced Error Handling: The error handling logic in validateLoadCodeAssistResponse has been refined to only throw an error if no allowedTiers are available, and to combine messages from multiple ineligibleTiers in such cases.
  • Comprehensive Test Coverage: New test cases have been added to cover scenarios where allowed tiers exist, where allowedTiers is undefined, and where multiple ineligible tier messages need to be combined, ensuring the corrected logic behaves as expected.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 addresses a regression where eligible tiers for code assist were incorrectly ignored for unlicensed users when other tiers were marked as ineligible. The change in packages/core/src/code_assist/setup.ts correctly modifies the validation logic to allow the process to continue if there are allowedTiers, even if ineligibleTiers are also present. The accompanying tests in packages/core/src/code_assist/setup.test.ts are thorough, covering the primary success case, edge cases like empty or undefined allowedTiers, and ensuring that VALIDATION_REQUIRED errors maintain precedence. The fix is sound and the test coverage is excellent. I have not found any issues of high or critical severity.

@gsquared94 gsquared94 force-pushed the fix-lca-eligible-tiers branch from 125c8ea to 77edb58 Compare January 26, 2026 21:16
@gemini-cli gemini-cli bot added the area/security Issues related to security label Jan 26, 2026
@gsquared94 gsquared94 force-pushed the fix-lca-eligible-tiers branch from 77edb58 to 3d6464f Compare January 27, 2026 01:30
@gsquared94 gsquared94 requested a review from a team as a code owner January 27, 2026 01:30
@gsquared94 gsquared94 force-pushed the fix-lca-eligible-tiers branch from 3d6464f to 8d962d9 Compare January 27, 2026 01:33
@gsquared94 gsquared94 force-pushed the fix-lca-eligible-tiers branch from 8d962d9 to 73b78c1 Compare January 27, 2026 01:49
@gsquared94 gsquared94 requested a review from sehoon38 January 27, 2026 02:28
@gemini-cli
Copy link
Contributor

gemini-cli bot commented Jan 27, 2026

Hi there! Thank you for your contribution to Gemini CLI. We really appreciate the time and effort you've put into this pull request.

To keep our backlog manageable and ensure we're focusing on current priorities, we are closing pull requests that haven't seen maintainer activity for 30 days. Currently, the team is prioritizing work associated with 🔒 maintainer only or help wanted issues.

If you believe this change is still critical, please feel free to comment with updated details. Otherwise, we encourage contributors to focus on open issues labeled as help wanted. Thank you for your understanding!

@gemini-cli gemini-cli bot closed this Jan 27, 2026
@galz10 galz10 reopened this Jan 27, 2026
@gsquared94 gsquared94 enabled auto-merge January 27, 2026 03:36
@gsquared94 gsquared94 added this pull request to the merge queue Jan 27, 2026
Merged via the queue into google-gemini:main with commit f4e7319 Jan 27, 2026
47 checks passed
@gsquared94 gsquared94 deleted the fix-lca-eligible-tiers branch January 27, 2026 03:55
yunaseoul pushed a commit that referenced this pull request Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/security Issues related to security

Projects

None yet

Development

Successfully merging this pull request may close these issues.

loadcodeassist eligible tiers getting ignored for unlicensed users (regression)

3 participants