Skip to content

Conversation

@hlshen
Copy link
Contributor

@hlshen hlshen commented Sep 8, 2025

Remove Gemini Code Assist as an extensionDependency. Instead, users are prompted to install it when they click "Build with Ai...".

Users will be taken to GCA chat when installation completes.

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.

Summary of Changes

Hello @hlshen, 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 refactors the integration with Gemini Code Assist, transforming it from a required extension into an optional, on-demand component. This change improves the initial setup experience by allowing users to install GCA only when needed, streamlining the core extension's footprint while maintaining full functionality for those who choose to utilize AI-powered features.

Highlights

  • Optional Gemini Code Assist Installation: Gemini Code Assist (GCA) is no longer a mandatory extension dependency. Users will now be prompted to install GCA only when they attempt to use its features, specifically by clicking the 'Build with AI...' button.
  • On-Demand Installation Flow: A new user flow has been implemented where, upon first interaction with GCA features, the system checks for its presence. If GCA is not installed, a prompt will appear, offering to install it. Upon successful installation, the GCA chat view will automatically open.
  • Updated Test Infrastructure: The test suite has been updated to reflect the optional nature of GCA. This includes removing GCA from default extension installations for tests and adding a new integration test specifically to validate the on-demand installation and activation flow of GCA.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 effectively makes the Gemini Code Assist extension optional by removing it as a dependency and prompting users to install it on demand. The implementation is solid and includes a new integration test to cover the installation flow. I've identified a critical issue in a test helper function that needs to be addressed, along with a couple of suggestions to improve code maintainability and test robustness.

Comment on lines 44 to 53
async getGeminiInstallNotification() {
const notifications = await this.workbench.getNotifications();
return notifications.find(async (n) => {
const message = await n.getMessage();
console.log("NOTIF MESSAGE: ", message);
return message.includes(
"The Firebase Assistant requires the Gemini Code Assist extension",
);
});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This implementation has a critical bug. Array.prototype.find does not work correctly with an async predicate because it doesn't await the promise returned by the predicate. It treats the pending promise object as a truthy value, so find will almost always return the first notification in the array, which can lead to flaky or incorrect tests. You should use a for...of loop to correctly await each message check.

Additionally, there is a console.log statement on line 48 that appears to be for debugging and should be removed.

  async getGeminiInstallNotification() {
    const notifications = await this.workbench.getNotifications();
    for (const n of notifications) {
      const message = await n.getMessage();
      if (
        message.includes(
          "The Firebase Assistant requires the Gemini Code Assist extension"
        )
      ) {
        return n;
      }
    }
  }

@hlshen hlshen requested review from fredzqm and joehan September 8, 2025 22:08
Copy link
Contributor

@fredzqm fredzqm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

High-level question.

Are we sure notification is the right means? It's unclear when developers want to use AI assistant tools. Feel like side button and code lens buttons can drive more engagement.

Users are more likely to want to generate query when they read those file.

Can you show a quick demo video of the onboard journey? Would help me understand. Thanks!

@hlshen
Copy link
Contributor Author

hlshen commented Sep 9, 2025

High-level question.

Are we sure notification is the right means? It's unclear when developers want to use AI assistant tools. Feel like side button and code lens buttons can drive more engagement.

Users are more likely to want to generate query when they read those file.

Can you show a quick demo video of the onboard journey? Would help me understand. Thanks!

It's the minimum change from current behavior. I spam the button here in the demo, think it's visible enough if the user is confused. Hoewver, we could make the button central. https://screencast.googleplex.com/cast/NTM1ODkwNTAyNTYyNjExMnxhMTA0YTRhOS01ZA

I think what you're asking might be for extra discovery methods? That may be a separate feature request.

@hlshen hlshen requested a review from fredzqm September 9, 2025 15:09
Copy link
Contributor

@joehan joehan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably want a changelog for this too, but lgtm.

@hlshen hlshen merged commit b0c9bd5 into master Sep 9, 2025
48 checks passed
@hlshen hlshen deleted the hlshen/gca-optional branch September 9, 2025 19:54
@github-project-automation github-project-automation bot moved this from Approved [PR] to Done in [Cloud] Extensions + Functions Sep 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants