Skip to content

AI_LoadSettingError: Google Vertex location setting is missing when using Gemini models #15838

Description

@ShivamB25

Bug Description

When attempting to use Google Vertex AI models (e.g., gemini-3.1-pro-preview), the application throws an AI_LoadSettingError indicating that the Google Vertex location setting is missing.

Error Message

AI_LoadSettingError: Google Vertex location setting is missing. Pass it using the 'location' parameter or the GOOGLE_VERTEX_LOCATION environment variable.

Expected Behavior

The application should properly recognize the GOOGLE_VERTEX_LOCATION environment variable or the location parameter and successfully authenticate with Google Vertex AI.

Actual Behavior

Setting GOOGLE_VERTEX_LOCATION environment variable does NOT resolve the error. The error persists even after:

  • Exporting GOOGLE_VERTEX_LOCATION=us-central1 (or other regions)
  • Trying different region values

This suggests the configuration is not being properly loaded or passed to the Google Vertex AI provider.

Steps to Reproduce

  1. Export the environment variable: export GOOGLE_VERTEX_LOCATION=us-central1
  2. Configure opencode to use a Google Vertex AI model (e.g., gemini-3.1-pro-preview)
  3. Run any command that triggers an LLM call
  4. Observe the AI_LoadSettingError still occurs

Environment

  • opencode CLI version: (please specify)
  • Model: gemini-3.1-pro-preview (Vertex AI)
  • OS: (please specify)
  • Attempted regions: us-central1, us-east1, etc.

Possible Causes

  • Environment variable not being read from the shell context where opencode runs
  • Configuration loading logic may have a bug in the Vertex AI provider
  • The location parameter may need to be set via config file instead of env var
  • Potential regression in recent versions

Request

Please investigate why the GOOGLE_VERTEX_LOCATION environment variable is not being recognized and provide a working solution or fix.


Reported via oh-my-opencode Sisyphus agent

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions