openclaw - ✅(Solved) Fix Google provider: implement proper Vertex AI OAuth and endpoint routing [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#60736Fetched 2026-04-08 02:47:50
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×2referenced ×2

The google-vertex hook alias exists but is a no-op — it routes through the same Gemini API OAuth flow with no Vertex AI-specific behavior. The Google provider needs proper Vertex AI support.

Root Cause

The google-vertex hook alias exists but is a no-op — it routes through the same Gemini API OAuth flow with no Vertex AI-specific behavior. The Google provider needs proper Vertex AI support.

Fix Action

Fixed

PR fix notes

PR #60860: feat(google): add Google Vertex AI provider with ADC auth and global endpoint routing

Description (problem / solution / changelog)

Summary

  • Registers a new google-vertex provider in the Google plugin that routes to aiplatform.googleapis.com using Application Default Credentials (ADC), separate from the existing google-gemini-cli OAuth path
  • Adds vertex-region.ts for region/project/baseUrl resolution (env vars + ADC file fallback), with global location producing the unprefixed aiplatform.googleapis.com endpoint
  • Adds vertex-provider-catalog.ts with the Gemini 3.x model catalog for Vertex AI
  • Updates the Google transport stream to detect Vertex endpoints and construct the correct project/location URL path (/v1/projects/{project}/locations/{location}/publishers/google/models/{model}:streamGenerateContent)
  • Exchanges ADC refresh token for a Bearer token at request time, handling the pi-ai "<authenticated>" sentinel that was previously sent as a literal API key causing 401s
  • Captures thought_signature from Gemini 3 thinking-mode tool call responses so multi-turn conversations replay correctly (fixes 400 INVALID_ARGUMENT on second turn)
  • Adds GCP_VERTEX_GOOGLE_CREDENTIALS_MARKER sentinel and registers google-vertex in openclaw.plugin.json

Closes #49039 Closes #56253 Closes #58775 Closes #60736

Test plan

  • pnpm test extensions/google/vertex-region.test.ts — 20 cases, all pass
  • pnpm test extensions/google/vertex-provider-catalog.test.ts — 7 cases, all pass
  • pnpm test src/infra/gemini-auth.test.ts — 5 cases, all pass
  • Live: google-vertex/gemini-3-flash-preview with GOOGLE_CLOUD_LOCATION=global and GOOGLE_CLOUD_PROJECT set — correct Vertex URL, Bearer auth, successful response

🤖 Generated with Claude Code

Changed files

  • extensions/google/api.ts (modified, +27/-9)
  • extensions/google/index.ts (modified, +47/-1)
  • extensions/google/openclaw.plugin.json (modified, +1/-1)
  • extensions/google/vertex-provider-catalog.test.ts (added, +85/-0)
  • extensions/google/vertex-provider-catalog.ts (added, +116/-0)
  • extensions/google/vertex-region.test.ts (added, +173/-0)
  • extensions/google/vertex-region.ts (added, +116/-0)
  • src/agents/google-transport-stream.ts (modified, +112/-7)
  • src/agents/google-vertex-adc.ts (added, +99/-0)
  • src/agents/model-auth-env.ts (modified, +10/-6)
  • src/agents/model-auth-markers.ts (modified, +2/-0)
  • src/agents/pi-embedded-runner/stream-resolution.ts (modified, +7/-0)
  • src/infra/gemini-auth.test.ts (modified, +13/-0)
  • src/infra/gemini-auth.ts (modified, +14/-4)
RAW_BUFFERClick to expand / collapse

Summary

The google-vertex hook alias exists but is a no-op — it routes through the same Gemini API OAuth flow with no Vertex AI-specific behavior. The Google provider needs proper Vertex AI support.

What's missing

  • Location/region: Vertex AI requires a region to construct the endpoint URL ({region}-aiplatform.googleapis.com). No location field exists in the Google provider config or onboarding.
  • Endpoint routing: The provider always hits generativelanguage.googleapis.com. Vertex AI uses {region}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/{model}.
  • Mode distinction: No way to distinguish between standard Gemini API mode and Vertex AI mode. The google-vertex alias should activate Vertex AI endpoint routing.

Requirements

  • Add location config field to the Google provider (with GOOGLE_CLOUD_LOCATION / CLOUD_ML_REGION env var fallback, default us-central1)
  • Construct Vertex AI endpoint URL when in Vertex mode
  • Support Vertex AI OAuth (the existing OAuth flow should work, but token scopes may need https://www.googleapis.com/auth/cloud-platform)
  • Onboarding flow should collect location when setting up via google-vertex
  • Project ID (already collected) + location must be used for Vertex AI API calls

Reference

  • Anthropic Vertex implementation for comparison: extensions/anthropic-vertex/region.ts
  • Google OAuth files: extensions/google/oauth.*.ts
  • Google provider entry: extensions/google/index.ts

extent analysis

TL;DR

Add a location config field to the Google provider and implement Vertex AI-specific endpoint routing and OAuth support to enable proper Vertex AI functionality.

Guidance

  • Add a location field to the Google provider config with a default value of us-central1 and environment variable fallbacks (GOOGLE_CLOUD_LOCATION or CLOUD_ML_REGION) to support region-based Vertex AI endpoint construction.
  • Update the endpoint routing to use the Vertex AI-specific URL format ({region}-aiplatform.googleapis.com/v1/projects/{project}/locations/{location}/publishers/google/models/{model}) when in Vertex AI mode.
  • Verify that the existing OAuth flow works with Vertex AI by checking the token scopes, potentially adding https://www.googleapis.com/auth/cloud-platform if necessary.
  • Modify the onboarding flow to collect the location when setting up with the google-vertex alias.

Example

No explicit code example is provided due to the lack of specific implementation details in the issue, but the extensions/anthropic-vertex/region.ts and extensions/google/oauth.*.ts files can serve as references for implementing the required changes.

Notes

The implementation details may vary depending on the specific requirements of the Google provider and Vertex AI integration, so it's essential to consult the referenced files and documentation for accurate implementation.

Recommendation

Apply a workaround by adding the necessary location config field and implementing Vertex AI-specific endpoint routing and OAuth support, as this will enable proper Vertex AI functionality until a more comprehensive solution is available.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING