← Back to PRs

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

by pdd-cli open 2026-02-19 21:16 View on GitHub →
agents size: XS
## 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](https://claude.com/claude-code) <!-- greptile_comment --> <h3>Greptile Summary</h3> 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-preview` → `gemini-3.1-pro-preview`, `gemini-3-flash-preview` → `gemini-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`). <h3>Confidence Score: 5/5</h3> - 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 <sub>Last reviewed commit: 8cae4e9</sub> <!-- greptile_other_comments_section --> <sub>(2/5) Greptile learns from your feedback when you react with thumbs up/down!</sub> <!-- /greptile_comment -->

Most Similar PRs