From 3d16c88b198ed3a4394375e4d0a1fa51072adf67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugues=20Clou=C3=A2tre?= <15008125+clouatre@users.noreply.github.com> Date: Wed, 13 May 2026 11:14:07 -0400 Subject: [PATCH] fix(providers): add Gemini 3.x known_location Global routing and KNOWN_MODELS entries (#9142) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hugues Clouâtre Signed-off-by: Douwe Osinga Co-authored-by: Douwe Osinga --- crates/goose/src/providers/formats/gcpvertexai.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/crates/goose/src/providers/formats/gcpvertexai.rs b/crates/goose/src/providers/formats/gcpvertexai.rs index c4ae9979..31d70bf3 100644 --- a/crates/goose/src/providers/formats/gcpvertexai.rs +++ b/crates/goose/src/providers/formats/gcpvertexai.rs @@ -75,6 +75,8 @@ pub const KNOWN_MODELS: &[&str] = &[ "claude-sonnet-4@20250514", "claude-3-5-haiku@20241022", "claude-3-haiku@20240307", + "gemini-3.1-flash-lite", + "gemini-3.1-pro-preview", "gemini-3-pro-preview", "gemini-3-flash-preview", "gemini-2.5-pro", @@ -112,13 +114,15 @@ impl fmt::Display for GcpVertexAIModel { impl GcpVertexAIModel { /// Returns the default GCP location for the model. /// - /// Each model family has a well-known location based on availability: - /// - Claude models default to Ohio (us-east5) - /// - Gemini models default to Iowa (us-central1) - /// - MaaS models default to Iowa (us-central1) + /// Location routing by model family: + /// - Claude models: Ohio (us-east5) + /// - Gemini 3.x models: Global + /// - Other Gemini models: Iowa (us-central1) + /// - MaaS models: Iowa (us-central1) pub fn known_location(&self) -> GcpLocation { match self { Self::Claude(_) => GcpLocation::Ohio, + Self::Gemini(name) if name.starts_with("gemini-3") => GcpLocation::Global, Self::Gemini(_) => GcpLocation::Iowa, Self::MaaS(_, _) => GcpLocation::Iowa, } @@ -369,6 +373,9 @@ mod tests { let gemini_model = GcpVertexAIModel::try_from("gemini-2.5-flash")?; assert_eq!(gemini_model.known_location(), GcpLocation::Iowa); + let gemini_3_model = GcpVertexAIModel::try_from("gemini-3.1-flash-lite")?; + assert_eq!(gemini_3_model.known_location(), GcpLocation::Global); + Ok(()) }