Skip to content

fix: add google-vertex support for Gemini 3.1 models#21263

Open
pdd-cli wants to merge 5 commits intoopenclaw:mainfrom
pdd-cli:fix/google-vertex-gemini-31-support
Open

fix: add google-vertex support for Gemini 3.1 models#21263
pdd-cli wants to merge 5 commits intoopenclaw:mainfrom
pdd-cli:fix/google-vertex-gemini-31-support

Conversation

@pdd-cli
Copy link

@pdd-cli pdd-cli commented Feb 19, 2026

Summary

  • live-model-filter.ts: isModernModelRef() now recognizes google-vertex as a valid provider alongside google and google-gemini-cli. Previously, google-vertex/gemini-3.1-pro-preview fell through to return false, causing "Unknown model" errors.

  • model-forward-compat.ts: Added forward-compat handler for gemini-3.1-* models that clones the corresponding gemini-3-* template from pi-ai's built-in catalog. This follows the same pattern used for claude-opus-4-6 (from claude-opus-4-5) and gpt-5.3-codex (from gpt-5.2-codex).

Context

Google released Gemini 3.1 Pro on Feb 19, 2026. Users configuring google-vertex/gemini-3.1-pro-preview hit two independent failures:

  1. The model filter didn't recognize google-vertex as a Google provider
  2. The model registry couldn't find gemini-3.1-pro-preview in pi-ai's catalog (which only has gemini-3-pro-preview)

Both fixes are needed — the filter fix alone isn't sufficient since the model still wouldn't resolve from the registry.

Test plan

  • Verify google-vertex/gemini-3.1-pro-preview resolves without error
  • Verify google-vertex/gemini-3.1-flash-preview resolves without error
  • Verify existing google-vertex/gemini-3-pro-preview still works
  • Verify google/gemini-3.1-pro-preview also works (forward-compat covers all Google providers)

🤖 Generated with Claude Code

Greptile Summary

Adds support for Google Vertex AI's newly released Gemini 3.1 models (gemini-3.1-pro-preview and gemini-3.1-flash-preview). The fix addresses two independent failures:

  • Filter fix: isModernModelRef() now recognizes google-vertex as a valid Google provider (line 59), allowing Gemini 3.1 requests to pass validation
  • Registry fix: resolveGoogleGemini31ForwardCompatModel() clones the corresponding Gemini 3 template configurations (gemini-3-pro-previewgemini-3.1-pro-preview, gemini-3-flash-previewgemini-3.1-flash-preview) when the 3.1 models aren't found in pi-ai's catalog

The implementation follows established patterns from other forward-compat handlers (claude-opus-4-6, gpt-5.3-codex, glm-5) and works across all Google provider variants (google-vertex, google, google-gemini-cli).

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The changes are minimal, focused, and follow established patterns in the codebase. Both modifications are necessary to fully enable Gemini 3.1 support - the filter fix allows google-vertex provider recognition, and the forward-compat handler ensures model resolution when the catalog lacks 3.1 entries. The implementation is conservative (explicit mapping vs wildcard matching), well-documented, and consistent with other forward-compat functions.
  • No files require special attention

Last reviewed commit: 8cae4e9

(2/5) Greptile learns from your feedback when you react with thumbs up/down!

@openclaw-barnacle openclaw-barnacle bot added agents Agent runtime and tooling size: XS labels Feb 19, 2026
@Skeptomenos
Copy link

Hey there! Thanks for adding support for Gemini 3.1.

Would it be possible to also add the gemini-3.1-pro-preview-customtools endpoint to the catalog in this PR?

According to the official Google documentation, this specific variant is explicitly optimized for agentic workflows that rely on bash and custom tools, which makes it particularly relevant for OpenClaw's architecture.

It would be amazing to have native support for this endpoint out of the box! Thanks for your hard work on this.

@Glucksberg
Copy link
Contributor

Flagging a potential link:

Several other PRs seem to address the same problem:

Both PRs add Gemini 3.1 model support to OpenClaw providers — PR#21263 targets google-vertex, PR#21257 targets google and google-antigravity.

Both approaches have merit — might be worth coordinating.

If any of these links don't look right, let me know and I'll correct them.

@pdd-cli pdd-cli force-pushed the fix/google-vertex-gemini-31-support branch 2 times, most recently from 0006cd4 to de5d9cb Compare February 26, 2026 18:53
Prompt Driven and others added 5 commits February 28, 2026 10:55
Adds a DiscordMemberAddListener that fires when a user joins a Discord
guild and delivers a system event to the matched agent session. Gated on
the existing intents.guildMembers privileged intent flag (must also be
enabled in the Discord Developer Portal). Opt-in per guild via
memberJoinNotifications: 'on' (default: 'off' to avoid high-volume
floods on existing deployments).

Closes openclaw#23978
Two issues prevented google-vertex/gemini-3.1-pro-preview from working:

1. live-model-filter.ts: isModernModelRef() only recognized "google" and
   "google-gemini-cli" providers but not "google-vertex", causing the
   model to fail the modern model filter.

2. model-forward-compat.ts: pi-ai's built-in catalog doesn't include
   gemini-3.1-* models yet. Added a forward-compat handler that clones
   the gemini-3-pro-preview / gemini-3-flash-preview templates for the
   corresponding gemini-3.1-* model IDs, matching the existing pattern
   used for Anthropic and OpenAI forward-compat models.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The customtools variant is a Vertex AI model tuned for agentic
workflows that prioritize custom tool calls over bash fallbacks.
Clone it from gemini-3-pro-preview like the base 3.1 model.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pdd-cli pdd-cli force-pushed the fix/google-vertex-gemini-31-support branch from de5d9cb to 7509950 Compare February 28, 2026 18:56
@openclaw-barnacle openclaw-barnacle bot added channel: discord Channel integration: discord size: S and removed size: XS labels Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling channel: discord Channel integration: discord size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants