Skip to content

fix(providers): add Gemini 3.x known_location Global routing and KNOWN_MODELS entries - #9142

Merged
DOsinga merged 3 commits into
aaif-goose:mainfrom
clouatre:fix/gemini3x-known-location
May 13, 2026
Merged

fix(providers): add Gemini 3.x known_location Global routing and KNOWN_MODELS entries#9142
DOsinga merged 3 commits into
aaif-goose:mainfrom
clouatre:fix/gemini3x-known-location

Conversation

@clouatre

@clouatre clouatre commented May 11, 2026

Copy link
Copy Markdown
Contributor

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 with gemini-3 to GcpLocation::Global, adds the two supported chat/tool-use models to KNOWN_MODELS using 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.rs
    • KNOWN_MODELS: added gemini-3.1-flash-lite, gemini-3.1-pro-preview
    • known_location(): inserted guard arm Self::Gemini(name) if name.starts_with("gemini-3") => GcpLocation::Global, before the existing catch-all Self::Gemini(_) => GcpLocation::Iowa,
    • Updated doc comment to say "Gemini 3 and later models" covering both gemini-3-* and gemini-3.1-* identifiers
    • test_model_parsing(): added parse assertions for both new model strings
    • test_default_locations(): added assertion verifying gemini-3.1-flash-lite routes to GcpLocation::Global

Test plan

  • Tests pass (cargo test -p goose --lib providers::formats::gcpvertexai)
  • Linter clean (cargo clippy --all-targets -- -D warnings)
  • Security scan clean (zero findings via aptu scan_security)
  • Existing gemini-2.x models unaffected (catch-all arm unchanged)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/goose/src/providers/formats/gcpvertexai.rs Outdated
@clouatre
clouatre force-pushed the fix/gemini3x-known-location branch from b6089c4 to 8566052 Compare May 11, 2026 16:06

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread crates/goose/src/providers/formats/gcpvertexai.rs Outdated
@clouatre
clouatre force-pushed the fix/gemini3x-known-location branch from 8566052 to 8e62362 Compare May 11, 2026 16:19
…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>
@clouatre
clouatre force-pushed the fix/gemini3x-known-location branch from 8e62362 to 06a33d1 Compare May 11, 2026 16:21
Douwe Osinga added 2 commits May 12, 2026 18:33
- 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 DOsinga left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@DOsinga
DOsinga added this pull request to the merge queue May 13, 2026
Merged via the queue into aaif-goose:main with commit 3d16c88 May 13, 2026
22 checks passed
shafqatevo pushed a commit to shafqatevo/goose that referenced this pull request Aug 7, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: known_location() returns Iowa for all Gemini models, breaking Gemini 3.x (global-endpoint only)

2 participants