Skip to content

Incorrect settings.json entry for Google Gemini 2.0 Flash Thinking causes linter warning #4168

@dev-ro

Description

@dev-ro

Description

When selecting the "Google Gemini 2.0 Flash Thinking" AI model from the GitLens dropdown menu in VS Code, the corresponding entry in settings.json is incorrectly set with the prefix "gemini:" instead of "google:". This results in a linter warning in settings.json because the value "gemini:gemini-2.0-flash-thinking-exp-01-21" does not match the expected pattern of "^((anthropic|deepseek|github|google|huggingface|openai|xai):([\w.-]+)|vscode)$".

While I am able to generate commit messages with the "gemini:" prefix, it's unclear if the GitLens extension is correctly utilizing the intended Google Gemini model.

Steps to Reproduce:

  1. Ensure you have Git installed and a Git repository open in VS Code.
  2. In the Source Control view (usually the third icon in the Activity Bar), locate the repository title bar with the "CHANGES" section.
  3. Click the three horizontal dots (...) located below the "CHANGES" line on this title bar.
  4. Select "Generate Commit Message with GitLens" from the dropdown menu.
  5. In the GitLens AI model selection prompt, choose "Google Gemini 2.0 Flash Thinking".
  6. Open your settings.json file (File > Preferences > Settings, then click "Open Settings (JSON)" in the top right).
  7. Locate the "gitlens.ai.model" entry and observe its value.

Expected Behavior:

When "Google Gemini 2.0 Flash Thinking" is selected from the dropdown, the settings.json entry for gitlens.ai.model should be set to a value starting with "google:", such as "google:gemini-2.0-flash-thinking-exp-01-21" (or a similar correct format). This would align with the expected pattern and avoid the linter warning.

Actual Behavior:

The settings.json entry is set with the prefix "gemini:", resulting in a linter warning.

Additional Information:

  • Changing the gitlens.ai.model value in settings.json directly (e.g., from "gemini:..." to "google:...") requires the user to re-select the AI model from the GitLens settings dropdown to choose a new language model. This suggests that the dropdown selection mechanism is the primary (and perhaps only) intended way to configure the AI model.

Potential Impact:

  • The linter warning can be misleading and suggest an incorrect configuration.
  • It's uncertain if the extension is correctly using the "Google" provider when the setting starts with "gemini:".

Please investigate this issue to ensure the correct settings.json entry is generated when selecting the Google Gemini model from the GitLens UI.

Suggestion:

Consider updating the dropdown selection logic to ensure that when a Google Gemini model is selected, the settings.json entry is correctly formatted with the "google:" prefix.

GitLens Version

16.3.3

VS Code Version

1.98.2

Git Version

git version 2.49.0.windows.1

Logs, Screenshots, Screen Captures, etc

Image

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions