Skip to content

fix(vertex): discover and route partner models correctly - #12471

Open
JxnLexn wants to merge 14 commits into
diegosouzapw:release/v3.8.51from
JxnLexn:dev/fix-vertex-ai-model-discovery
Open

fix(vertex): discover and route partner models correctly#12471
JxnLexn wants to merge 14 commits into
diegosouzapw:release/v3.8.51from
JxnLexn:dev/fix-vertex-ai-model-discovery

Conversation

@JxnLexn

@JxnLexn JxnLexn commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • support both Vertex API keys and Service Account JSON credentials without mixing their capabilities
  • infer and persist the Google Cloud consumer project for project-scoped API-key partner inference
  • use API-key model discovery only for Gemini and fall back intentionally to a curated project-scoped catalog because Google rejects API keys for publishers.models.list
  • fetch the live Model Garden catalog for Google, xAI, Anthropic, Mistral, and open-MaaS publishers with OAuth or Service Account credentials using Google's maximum page size of 300
  • treat the authenticated Google publisher catalog as the live source for current Gemini chat models, including Gemini 3.5, 3.6, 3.7, and 3.8 Flash
  • retain successful publisher results when the separate Gemini Developer API rejects Service Accounts
  • accept requestAccess-backed MaaS model cards while excluding image, TTS, live, transcription, embedding, OCR-only, and retired Gemini entries from the chat catalog
  • replace invalid speculative Vertex IDs with documented MaaS IDs such as deepseek-ai/deepseek-v3.2-maas, qwen/qwen3-next-80b-a3b-instruct-maas, and zai-org/glm-5-maas
  • route Gemini, Anthropic, Mistral, xAI, and generic OpenAI-compatible MaaS publishers through their correct transports
  • label the dashboard credential field accurately and explain that Service Account JSON enables live Model Garden discovery
  • reject OAuth client configuration JSON with a specific explanation instead of reporting missing Service Account fields

Authentication behavior

A project-bound API key can execute partner models, but Google does not allow it to call Model Garden publishers.models.list. OmniRoute extracts the bound project from structured Google error metadata and uses the curated project-scoped catalog.

A Service Account JSON credential is exchanged for an OAuth access token. That bearer token can list publishers/google/models and the partner publisher catalogs, so successful discovery now returns catalogMode=live_vertex_catalog without supplementing the result with a stale static Gemini baseline.

Google separately rejects Service Accounts on generativelanguage.googleapis.com. That expected rejection no longer marks the entire Vertex discovery as failed.

An OAuth web-client JSON file is only client configuration and is not itself an access credential. It requires a complete authorization-code and refresh-token flow and is now rejected with a clear message.

Reproduction covered

The live Publisher Model list request used pageSize=1000 although Google enforces a maximum of 300. Every publisher returned HTTP 400, leaving an empty discovery result and causing Sync Models to report:

Vertex model catalogs unavailable — using local catalog

The corrected request returns the live Google and partner catalogs. Gemini chat filtering is capability-oriented: current Flash/Flash Lite/Pro variants from Gemini 2.5 onward are imported, while non-chat and retired entries are excluded.

Verification

  • focused Vertex Node tests on the release branch: 24 passed
  • focused provider-dialog tests from the credential UI change: 20 passed
  • npm run typecheck:core
  • live Service Account token exchange: HTTP 200
  • deployed fork image revision fed218e
  • deployed live discovery: source=api, catalogMode=live_vertex_catalog, 29 synchronized models, no warning
  • deployed live catalog includes gemini-3.5-flash, gemini-3.6-flash, gemini-3.7-flash, gemini-3.8-flash, claude-opus-4-1, and mistral-medium-3
  • deployed catalog excludes image, TTS, retired Gemini 1.5, and the former speculative partner IDs
  • deployed vertex/gemini-3.7-flash model test: HTTP 200

@JxnLexn JxnLexn changed the title fix(vertex): support Express catalogs and xAI MaaS routing fix(vertex): discover and route partner models correctly Sep 2, 2026
JxnLexn and others added 12 commits September 2, 2026 16:03
Keep the PR's Model Garden MaaS ids and xAI catalog spread, and keep
the release tip's new Gemma 4 / DeepSeek V4 / Qwen 3.6 / GLM-5.1 /
Claude Fable 5.1 entries.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
en.json and de.json already had the keys; the i18n parity test failed
on pt-BR (and the other 39 locales). Copy the English fallback next to
vertexServiceAccountPlaceholder so every locale has both keys.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Move Vertex model-listing out of the frozen models route and credential
copy out of EditConnectionModal so both stay under their file-size caps.
Split publisher parsing and URL building into helpers to keep the
complexity ratchet at the merge-base. Drop the bare Gemma / DeepSeek-V4 /
Qwen3.6 / GLM-5.1 ids the merge reintroduced; they are unroutable without
a publisher namespace and this PR already replaced them with MaaS ids.
Sync the free-tier catalog counts (437 → 443).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Keep the PR's Model Garden MaaS ids and xAI catalog spread, and keep
the release tip. Drop the bare Gemma / DeepSeek-V4 / Qwen 3.6 / GLM-5.1
ids the tip reintroduced; they are unroutable without a publisher
namespace. Sync free-tier catalog counts (444 → 450).

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.com>
Regenerate the budget card and FREE-TIERS-GUIDE to 450 entries so they
match the merged namespaced Vertex catalog.

Co-authored-by: diegosouzapw <8016841+diegosouzapw@users.noreply.github.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.

1 participant