GoogleCloudPlatform / cloud-code-vscode

Cloud Code for Visual Studio Code: Issues, Documentation and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gemini Code Assist does not work with special HEX strings (billing account id) in code

michimeier opened this issue · comments

Version information

Cloud Code Extension version:

[6.6.2024, 11:14:48] Cloud Code version 2.11.3
[6.6.2024, 11:14:48] Version detail: 640379469 built on 2024-06-05T04:43:08.222Z

VSCode version: 1.90.0 (Universal) / Commit: 89de5a8d4d6205e5b11647eb6a74844ca23d2573

OS: macOS Sonoma 14.5 (23F79)

Cloud SDK:

Google Cloud SDK 479.0.0
beta 2024.05.31
bq 2.1.5
core 2024.05.31
gcloud-crc32c 1.0.0
gsutil 5.29

Description

Using Gemini Code Assist: Chat in VS Code leads to an error Sorry, I can't help you with this. when selecting a part of the code in the editor and clicking on "Explain this". The "Context Sources" is the right one but it does not fulfill the request. Also directly asking for generating code does not work.

Repro step

  1. Open a Python file (or create a new one)
  2. Add the following code:
    billing_account_id = "000000-000FFF-FFFFFF"   # This id is an example (hopefully) having no real project behind it
    print(billing_account_id)
    
  3. Save the file
  4. Select all the code
  5. Open Gemini Code Assist
  6. Click on Explain this

Problem cause and workaround

The Google Cloud billing account id looks like it is the root cause of the problem.

Adding or removing a random character of the "hex" string like identifier solves the problem and Gemini Code Assist can "Explain this" selected code.

If you change one of the "HEX" characters in the string (except "-") to be out of the HEX code boundaries (e.g. to "G" or "Z"), than the problem also disappears.

Can you please file this using send feedback in the extension.

Thanks! We'll take a look at those and weigh back in here ASAP!