Skip to content

fix: treat GOOGLE_GENAI_USE_VERTEXAI=false as disabled - #4303

Draft
yunus25jmi1 wants to merge 1 commit into
docker:mainfrom
yunus25jmi1:fix/vertexai-false-disabled-4292
Draft

yunus25jmi1 wants to merge 1 commit into
docker:mainfrom
yunus25jmi1:fix/vertexai-false-disabled-4292

Conversation

@yunus25jmi1

Copy link
Copy Markdown
Contributor

Fixes #4292.

GOOGLE_GENAI_USE_VERTEXAI was enabled by mere presence in pkg/model/provider/gemini/client.go, so =false still routed Google-typed custom providers with base_url + token_key to the Vertex/ADC path where token_key is ignored. It also disagreed with pkg/config/gather.go (non-empty check).

Changes:

  • Parse the flag as a boolean (strconv.ParseBool) in client routing, config preflight, and provider auto-detection — only truthy values enable Vertex; false/0/empty stay on the direct Gemini API path.
  • Updated Google provider docs (no longer 'any value').
  • Regression coverage: custom Google provider with base_url + token_key under =false still sends the token_key API key (gemini); gather returns API-key vs Vertex project/location per flag value (config).

Verified: go build ./..., go test ./pkg/model/provider/gemini/ ./pkg/config/, golangci-lint on touched packages, gofmt/go vet clean.

@yunus25jmi1
yunus25jmi1 requested a review from a team as a code owner September 15, 2026 12:16
@aheritier aheritier added area/config For configuration parsing, YAML, environment variables area/docs Documentation changes area/providers For features/issues/fixes related to LLM providers (Bedrock, LiteLLM, Qwen, custom, etc.) area/providers/gemini Google Gemini provider support kind/fix PR fixes a bug (maps to fix:). Use on PRs only. status/needs-signed-commits Some commits in the PR are signed with a valid SSH/GPG key labels Sep 15, 2026
@aheritier

Copy link
Copy Markdown
Collaborator

👋 Some commits in this PR are not signed and verified by GitHub. Please sign your commits with a GPG or SSH key registered in your GitHub account, then force-push.

Commits that are not verified: 0da4eac

See GitHub's guide on signing commits for setup instructions. I've added status/needs-signed-commits; it will be removed automatically once every commit in this PR carries a valid GitHub-verified signature.

Parse GOOGLE_GENAI_USE_VERTEXAI as a boolean (strconv.ParseBool) in
the Gemini client routing, config preflight (gather), and provider
auto-detection, so false/0/empty no longer select the Vertex/ADC path
where token_key is ignored. Aligns all three with the same semantics
and updates the Google provider docs.

Fixes docker#4292.
@yunus25jmi1
yunus25jmi1 force-pushed the fix/vertexai-false-disabled-4292 branch from 0da4eac to c0cac39 Compare September 15, 2026 12:37
@yunus25jmi1
yunus25jmi1 marked this pull request as draft September 15, 2026 12:42
@yunus25jmi1
yunus25jmi1 marked this pull request as ready for review September 15, 2026 12:42

@aheritier aheritier left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review: the implementation is sound. It correctly treats GOOGLE_GENAI_USE_VERTEXAI=false as disabled, aligns configuration validation with runtime routing, includes regression coverage for the Google custom-provider path using base_url and token_key, and updates the documentation. I found no code-quality issues in the changed lines.

This is not approvable yet because required ci / gate is red at c0cac39dae6d3b1866eaa987a36f916975b17aa0 (test-linux failed in pkg/tools/mcp.TestRemoteClientCallToolAbortsOnContextDeadline, pkg/tools/mcp/remote_test.go:646) and the head commit is still not GitHub-verified (no_user; status/needs-signed-commits remains applied). Once the gate is green and the commit is verified, this is approvable on its code merits.

@aheritier
aheritier marked this pull request as draft September 15, 2026 20:43
@aheritier aheritier added the status/needs-rebase PR has merge conflicts or is out of date with main label Sep 19, 2026
@aheritier

Copy link
Copy Markdown
Collaborator

👋 This PR has merge conflicts with the base branch. Please rebase or merge the latest base branch and resolve them. I've moved it to draft and added status/needs-rebase; it'll be picked back up automatically once the conflicts are cleared.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/config For configuration parsing, YAML, environment variables area/docs Documentation changes area/providers/gemini Google Gemini provider support area/providers For features/issues/fixes related to LLM providers (Bedrock, LiteLLM, Qwen, custom, etc.) kind/fix PR fixes a bug (maps to fix:). Use on PRs only. status/needs-rebase PR has merge conflicts or is out of date with main status/needs-signed-commits Some commits in the PR are signed with a valid SSH/GPG key

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: treat GOOGLE_GENAI_USE_VERTEXAI=false as disabled

2 participants