gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

Cannot Switch Google Account in Gemini Code Assist VS Code Extension — Only Initial Account Works

Open VenkatKwest opened this issue 1 year ago • 5 comments

When using Gemini Code Assist in VS Code, only the first Google account I signed in with works. After signing out and attempting to sign in with a different eligible account (including Gemini Pro), the extension gets stuck on "loading" under the sign-in panel and does not complete authentication.

Troubleshooting steps attempted:

  • Signed out of Gemini Code Assist in VS Code.
  • Uninstalled/reinstalled the extension.
  • Deleted the google.geminicodeassist cache folder in %APPDATA%\Code\User\globalStorage.
  • Cleared browser cookies and site data.
  • Revoked account permissions for Gemini Code Assist in Google Account settings.
  • Set "cloudcode.beta.forceOobLogin": true in settings.json.
  • Used both standard and Incognito mode login.
  • Restarted VS Code and my computer.

Result: Despite these steps, only the original account ever works. Every attempt to sign in with another account stalls at loading and never proceeds to chat or code features, even though the new account is eligible and can use Gemini in the browser.

VenkatKwest avatar Sep 30 '25 02:09 VenkatKwest

If you remove the name of the old project in settings, the login process will allow you to chose the new/valid project rather than being stuck on connecting to an invalid project. See: https://github.com/google-gemini/gemini-cli/issues/10918

ldkafka avatar Nov 03 '25 18:11 ldkafka

Hi @ldkafka,

Thank you for pointing to #10918. I can confirm that the issue initially appeared to be related to persisted project configuration state in the extension's workspace settings.

However, I should clarify that in my case, I did not manually modify or delete any project identifiers from settings.json or the VS Code workspace configuration. When I attempted to reproduce the authentication flow last week with a different Google account, the OAuth2 handshake completed successfully without intervention.

This suggests that the authentication token refresh mechanism or the project binding logic may have been corrected server-side, or there was a transient issue with the Google Cloud Project ID validation during my initial attempts.

Given that the authentication is now functioning properly across multiple accounts without requiring manual cleanup of cached project references, it appears the root cause may have been resolved. I'll monitor for any recurrence and provide additional telemetry if the issue resurfaces.

VenkatKwest avatar Nov 06 '25 00:11 VenkatKwest

@VenkatKwest I was still having the issue 2 days ago with the latest versions installed.

In my case, I was switching from Google account 1 to Google account 2, which had 2 gemini code assist project in it.

Logging out of account 1 and logging into account 2 ended up stuck on the login step. It never got through to offering which project I want to choose.

Logging out first, then deleting the project name in the settings, then logging into the new account worked for me.

ldkafka avatar Nov 06 '25 05:11 ldkafka

@ldkafka Thank you for sharing this solution. I’m glad to report that the issue has been resolved on my end. However, if I encounter the problem again, I’ll make sure to try your suggested approach.

VenkatKwest avatar Nov 07 '25 01:11 VenkatKwest

Hello! As part of our effort to keep our backlog manageable and focus on the most active issues, we are tidying up older reports.

It looks like this issue hasn't been active for a while, so we are closing it for now. However, if you are still experiencing this bug on the latest stable build, please feel free to comment on this issue or create a new one with updated details.

Thank you for your contribution!

gemini-cli[bot] avatar Jan 04 '26 00:01 gemini-cli[bot]