Fix GCP Vertex AI global endpoint support for Gemini 3 models#6187
Fix GCP Vertex AI global endpoint support for Gemini 3 models#6187katzdave merged 2 commits intoblock:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes GCP Vertex AI global endpoint support for Gemini 3 models by correcting the URL construction from https://global-aiplatform.googleapis.com to https://aiplatform.googleapis.com.
- Adds
GcpLocation::Globalvariant andbuild_host_url()method to properly construct URLs for global vs regional endpoints - Removes the fallback retry logic and
known_location()method as part of simplification - Includes comprehensive test coverage with 4 new tests for the URL construction and location handling
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
crates/goose/src/providers/gcpvertexai.rs |
Adds build_host_url() method to construct correct URLs for global/regional endpoints; removes fallback retry logic; adds tests for URL construction |
crates/goose/src/providers/formats/gcpvertexai.rs |
Adds GcpLocation::Global variant with is_global() helper; removes unused TryFrom<&str> impl and known_location() method; adds tests for location display and global checking |
|
Thanks @katzdave for the review! All feedback addressed in the latest commit - simplified by removing the |
6800bfc to
ef26556
Compare
|
Rebased onto main to resolve conflicts with #6191 (streaming support). Ready for merge. |
625aa3d to
ab76ef5
Compare
|
Rebased onto latest main following fixes in #6512. CI now passing. |
|
@clouatre Following back up here, seems like 1 more merge conflict, but otherwise would be great to merge! |
- Add GcpLocation::Global variant with is_global() helper - Add build_host_url() to construct correct URLs: - Global: https://aiplatform.googleapis.com - Regional: https://{location}-aiplatform.googleapis.com - Remove known_location() method and fallback retry logic - Remove TryFrom<&str> impl for GcpLocation (no longer needed) - Add 4 new tests for global endpoint URL construction Fixes block#6186 Signed-off-by: Hugues Clouâtre <hugues@linux.com>
- Remove is_global() method and empty impl block from GcpLocation - Remove comment block above build_host_url (self-documenting) - Remove 4 tests that directly mirror code without adding value: - test_gcp_location_display - test_gcp_location_is_global - test_build_host_url_regional - test_build_host_url_global Signed-off-by: Hugues Clouâtre <hugues@linux.com>
ab76ef5 to
4936cd5
Compare
|
@katzdave Rebased and resolved the conflict. Also fixed |
* origin/main: Fix GCP Vertex AI global endpoint support for Gemini 3 models (#6187) fix: macOS keychain infinite prompt loop (#6620) chore: reduce duplicate or unused cargo deps (#6630) feat: codex subscription support (#6600) smoke test allow pass for flaky providers (#6638) feat: Add built-in skill for goose documentation reference (#6534) Native images (#6619) docs: ml-based prompt injection detection (#6627) Strip the audience for compacting (#6646) chore(release): release version 1.21.0 (minor) (#6634) add collapsable chat nav (#6649) fix: capitalize Rust in CONTRIBUTING.md (#6640) chore(deps): bump lodash from 4.17.21 to 4.17.23 in /ui/desktop (#6623) Vibe mcp apps (#6569) Add session forking capability (#5882) chore(deps): bump lodash from 4.17.21 to 4.17.23 in /documentation (#6624) fix(docs): use named import for globby v13 (#6639) PR Code Review (#6043) fix(docs): use dynamic import for globby ESM module (#6636) # Conflicts: # Cargo.lock # crates/goose-server/src/routes/session.rs
|
For anyone wondering why this isn't working: the latest release of Goose (1.2.1) does not have this fix baked in. I built from source (main branch) and confirmed this was resolved. Hopefully it's included in 1.2.2 |
…o dkatz/canonical-context * 'dkatz/canonical-provider' of github.com:block/goose: (27 commits) docs: add Remotion video creation tutorial (#6675) docs: export recipe and copy yaml (#6680) Test against fastmcp (#6666) docs: mid-session changes (#6672) Fix MCP elicitation deadlock and improve UX (#6650) chore: upgrade to rmcp 0.14.0 (#6674) [docs] add MCP-UI to MCP Apps blog (#6664) ACP get working dir from args.cwd (#6653) Optimise load config in UI (#6662) Fix GCP Vertex AI global endpoint support for Gemini 3 models (#6187) fix: macOS keychain infinite prompt loop (#6620) chore: reduce duplicate or unused cargo deps (#6630) feat: codex subscription support (#6600) smoke test allow pass for flaky providers (#6638) feat: Add built-in skill for goose documentation reference (#6534) Native images (#6619) docs: ml-based prompt injection detection (#6627) Strip the audience for compacting (#6646) chore(release): release version 1.21.0 (minor) (#6634) add collapsable chat nav (#6649) ...
Summary
Fixes the GCP Vertex AI provider to support the global endpoint required for Gemini 3 models. The previous implementation incorrectly constructed the URL as
https://global-aiplatform.googleapis.cominstead ofhttps://aiplatform.googleapis.com.Type of Change
AI Assistance
Testing
Unit Tests:
test_gcp_location_display,test_gcp_location_is_global,test_build_host_url_global,test_build_host_url_regionalcargo fmt --check✓,./scripts/clippy-lint.sh✓Manual Live Testing (100% Working):
Built release binary and tested with actual GCP Vertex AI API:
gemini-3-flash-previewwithGCP_LOCATION=global- SUCCESShttps://aiplatform.googleapis.comgemini-3-pro-previewwithGCP_LOCATION=global- SUCCESSgemini-2.0-flash-001withGCP_LOCATION=us-central1- SUCCESSVerification:
Related Issues
Fixes #6186
Changes
GcpLocation::Globalvariant withis_global()helper methodbuild_host_url()method to handle global vs regional URL construction:https://aiplatform.googleapis.comhttps://{location}-aiplatform.googleapis.comknown_location()method and fallback retry logic (simplification)TryFrom<&str>impl forGcpLocation(no longer needed)Impact
crates/goose/src/providers/formats/gcpvertexai.rs,crates/goose/src/providers/gcpvertexai.rs