Skip to content

Re-request consent if necessary when updating extensions#9517

Merged
jakemac53 merged 8 commits into
mainfrom
re-request-content-on-update
Sep 25, 2025
Merged

Re-request consent if necessary when updating extensions#9517
jakemac53 merged 8 commits into
mainfrom
re-request-content-on-update

Conversation

@jakemac53

Copy link
Copy Markdown
Contributor

TLDR

When updating an extension, we compare the old consent text to the new consent text, and if they are different then we require the user to consent again.

Dive Deeper

There is no consent flow in interactive mode, so we default today to giving an error and just telling the user to run it on the command line. This is what that looks like:

image

Reviewer Test Plan

Try to update an extension which has added some new feature that requires consent both on the command line and in interactive mode.

Testing Matrix

🍏 🪟 🐧
npm run
npx
Docker
Podman - -
Seatbelt - -

Linked issues / bugs

Fixes #9400

@jakemac53 jakemac53 requested a review from a team as a code owner September 24, 2025 21:03
@jakemac53 jakemac53 requested a review from chrstnb September 24, 2025 21:03
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @jakemac53, 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 enhances the extension management system by introducing a robust consent re-request mechanism during updates. It ensures that users are prompted for consent if an extension's permissions or operational scope changes, improving transparency and security. The implementation distinguishes between interactive and non-interactive CLI environments for consent handling, laying the groundwork for future interactive consent flows.

Highlights

  • Consent Re-request on Extension Update: Implemented a mechanism to re-request user consent when an extension is updated, but only if the consent text (e.g., permissions, server usage, excluded tools) has changed since the last installation. This ensures users are always aware of new or modified permissions.
  • Differentiated Consent Handling: Introduced separate functions for handling consent in non-interactive (requestConsentNonInteractive) and interactive (requestConsentInteractive) modes. The interactive mode currently informs the user to use the command line for updates requiring consent, as direct interactive consent is not yet fully implemented.
  • Refactored Extension Installation Logic: The installExtension function now accepts a requestConsent callback and an optional previousExtensionConfig. This allows for dynamic consent prompting based on the context (e.g., install, update, migration) and comparison with prior configurations.
  • Update Command Integration: The updateExtension and updateAllUpdatableExtensions functions have been updated to utilize the new consent mechanism, passing the appropriate requestConsent function based on whether the operation is interactive or non-interactive.
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.

@github-actions

github-actions Bot commented Sep 24, 2025

Copy link
Copy Markdown

Size Change: +1.66 kB (+0.01%)

Total Size: 17.4 MB

Filename Size Change
./bundle/gemini.js 17.4 MB +1.66 kB (+0.01%)
ℹ️ View Unchanged
Filename Size
./bundle/sandbox-macos-permissive-closed.sb 1.03 kB
./bundle/sandbox-macos-permissive-open.sb 830 B
./bundle/sandbox-macos-permissive-proxied.sb 1.31 kB
./bundle/sandbox-macos-restrictive-closed.sb 3.29 kB
./bundle/sandbox-macos-restrictive-open.sb 3.36 kB
./bundle/sandbox-macos-restrictive-proxied.sb 3.56 kB

compressed-size-action

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 refactors the extension consent mechanism. Instead of a boolean flag, installExtension now accepts a requestConsent function, allowing for different consent flows in interactive and non-interactive modes. It also introduces logic to re-request consent during an update if the extension's required permissions have changed. The changes touch installation, linking, and updating of extensions, along with their corresponding tests and UI components. I've found one critical issue with the rollback logic that could lead to data loss.

Comment thread packages/cli/src/config/extensions/update.ts Outdated
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@chrstnb

chrstnb commented Sep 25, 2025

Copy link
Copy Markdown
Contributor

This looks good overall, but to clarify: are we showing the consent info on all updates? I'm not sure that we need to render it in the UI at all honestly, we can just say "this requires new consent to update, please update manually"

@jakemac53

Copy link
Copy Markdown
Contributor Author

This looks good overall, but to clarify: are we showing the consent info on all updates? I'm not sure that we need to render it in the UI at all honestly, we can just say "this requires new consent to update, please update manually"

Sure I will update it to not output the actual consent text, can include that back in once the consent flow is implemented.

@jakemac53

Copy link
Copy Markdown
Contributor Author

Ok, it now looks like this
image

@chrstnb

chrstnb commented Sep 25, 2025

Copy link
Copy Markdown
Contributor

One last nit: is there a way to improve the Installation cancelled by user piece?

@jakemac53

Copy link
Copy Markdown
Contributor Author

One last nit: is there a way to improve the Installation cancelled by user piece?

Updated to just "Installation cancelled"

@chrstnb chrstnb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

:shipit:

@jakemac53 jakemac53 added this pull request to the merge queue Sep 25, 2025
Merged via the queue into main with commit a0c8e3b Sep 25, 2025
17 of 19 checks passed
@jakemac53 jakemac53 deleted the re-request-content-on-update branch September 25, 2025 18:07
geoffdowns pushed a commit to geoffdowns/gemini-cli that referenced this pull request Sep 26, 2025
…ni#9517)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
jkcinouye pushed a commit that referenced this pull request Sep 29, 2025
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
thacio added a commit to thacio/auditaria that referenced this pull request Oct 4, 2025
giraffe-tree pushed a commit to giraffe-tree/gemini-cli that referenced this pull request Oct 10, 2025
…ni#9517)

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
cocosheng-g pushed a commit that referenced this pull request May 6, 2026
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@sripasg sripasg added the size/l A large sized PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/l A large sized PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Re-request consent on extension update

3 participants