fix(providers): add Gemini 3.x known_location Global routing and KNOWN_MODELS entries - #9142
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6089c4b38
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
b6089c4 to
8566052
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85660526ec
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
8566052 to
8e62362
Compare
…N_MODELS entries Gemini 3.x models require the global Vertex AI endpoint; without the guard arm they fell through to the Iowa catch-all and failed at runtime. - Add guard arm in known_location(): Gemini(name) starting with 'gemini-3' routes to GcpLocation::Global before the catch-all arm - Add gemini-3.1-flash-lite-preview, gemini-3.1-pro-preview, and gemini-3.1-flash-image to KNOWN_MODELS - Add regression tests for parse correctness and location dispatch Fixes: aaif-goose#9141 Signed-off-by: Hugues Clouâtre <hugues@linux.com>
8e62362 to
06a33d1
Compare
- Remove gemini-3.1-flash-lite and gemini-3.1-pro-preview parse assertions since test_unknown_model_parsing already covers that any gemini-* string parses as Gemini(_) - Fix doc comment to say "Gemini 3.x" instead of "Gemini 3 and later" since the guard only matches names starting with "gemini-3" Signed-off-by: Douwe Osinga <douwe@squareup.com>
DOsinga
left a comment
There was a problem hiding this comment.
LGTM. Small, well-motivated fix for Gemini 3.x location routing backed by issue #9141. Codex comments were already addressed. I pushed a cleanup commit removing the trivial parse tests (already covered by test_unknown_model_parsing) and tightening the doc comment.
…N_MODELS entries (aaif-goose#9142) Signed-off-by: Hugues Clouâtre <hugues@linux.com> Signed-off-by: Douwe Osinga <douwe@squareup.com> Co-authored-by: Douwe Osinga <douwe@squareup.com>
Summary
Fixes the
known_location()regression for Gemini 3.x models on Vertex AI (closes #9141). Gemini 3 and later require the global endpoint; without a guard arm these models fell through to the Iowa catch-all and failed at runtime. The fix adds a match guard arm routing any model name starting withgemini-3toGcpLocation::Global, adds the two supported chat/tool-use models toKNOWN_MODELSusing their canonical API identifiers (verified against the Vertex AI Model Garden), and includes regression tests covering both parse correctness and location dispatch.Changes
crates/goose/src/providers/formats/gcpvertexai.rsKNOWN_MODELS: addedgemini-3.1-flash-lite,gemini-3.1-pro-previewknown_location(): inserted guard armSelf::Gemini(name) if name.starts_with("gemini-3") => GcpLocation::Global,before the existing catch-allSelf::Gemini(_) => GcpLocation::Iowa,gemini-3-*andgemini-3.1-*identifierstest_model_parsing(): added parse assertions for both new model stringstest_default_locations(): added assertion verifyinggemini-3.1-flash-literoutes toGcpLocation::GlobalTest plan
cargo test -p goose --lib providers::formats::gcpvertexai)cargo clippy --all-targets -- -D warnings)