Skip to content

Google provider: implement proper Vertex AI OAuth and endpoint routing #60736

@PewterZz

Description

@PewterZz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal backlog priority with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.staleMarked as stale due to inactivity

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions