Skip to content

The environment variable GOOGLE_GENAI_USE_VERTEXAI affects GOOGLE GEMINI #7968

@dielect

Description

@dielect

App Version

3.28.1

API Provider

Google Vertex AI

Model Used

gemini-2.5-pro

Roo Code Task Links (Optional)

No response

🔁 Steps to Reproduce

  1. macOS 15.6.1 (24G90) Apple M4
  2. I previously set Google Gemini as the model provider, but often encountered the problem of model overload, so I tried to modify the configuration to GCP Vertex AI. Then the strange thing happened. When I re-added Google Gemini as the provider and enabled it, it always reported an error: Gemini Generation Context Stream Error: urlContext parameter is not supported in Vertex AI. I understand that this parameter is not supported in Vertex AI, but my question is why it is using my Vertex AI configuration

💥 Outcome Summary

Expected Behavior

When the "Google Gemini" provider is selected and enabled, all subsequent API requests should be routed directly to the Google Gemini API endpoint. These requests should use parameters valid for the Gemini API (like urlContext) and should be completely independent of any previous Vertex AI configuration.

Actual Behavior

After re-enabling the "Google Gemini" provider, the application fails with the following error:
Gemini 生成上下文流错误:urlContext parameter is not supported in Vertex AI.

📄 Relevant Logs or Errors (Optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue - Needs InfoMissing details or unclear. Waiting on author to provide more context.bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions