#21181: fix(models): add gemini-3.1-pro-preview forward-compat for google-gemini-cli provider
agents
size: XS
Cluster:
Gemini Provider Enhancements
## Summary
- **Problem:** `gemini-3.1-pro-preview` launched 2026-02-19 and works via the standalone Gemini CLI (`gemini -m gemini-3.1-pro-preview`), but OpenClaw rejects it with `Unknown model: google-gemini-cli/gemini-3.1-pro-preview` because pi-ai's built-in model catalog doesn't include it yet.
- **Why it matters:** Users on `google-gemini-cli` cannot use the new model until the catalog is updated.
- **What changed:** Added a `resolveGeminiCli31ProPreviewForwardCompatModel` forward-compat resolver in `src/agents/model-forward-compat.ts` that clones `gemini-3-pro-preview` as `gemini-3.1-pro-preview` — the same pattern used for `claude-opus-4-6`, `glm-5`, and `gemini-3-pro-image` in the existing codebase.
- **What did NOT change:** No behavioral changes for any other provider or model.
## Change Type (select all)
- [x] Bug fix
- [ ] Feature
- [ ] Refactor
- [ ] Docs
- [ ] Security hardening
- [ ] Chore/infra
## Scope (select all touched areas)
- [ ] Gateway / orchestration
- [ ] Skills / tool execution
- [ ] Auth / tokens
- [ ] Memory / storage
- [ ] Integrations
- [ ] API / contracts
- [ ] UI / DX
- [ ] CI/CD / infra
## User-visible / Behavior Changes
- `google-gemini-cli/gemini-3.1-pro-preview` now resolves to a cloned `gemini-3-pro-preview` model definition, unblocking users who upgraded the Gemini CLI and set the new model in their config.
## Security Impact (required)
- New permissions/capabilities? No
- Secrets/tokens handling changed? No
- New/changed network calls? No
- Command/tool execution surface changed? No
- Data access scope changed? No
## Repro + Verification
1. Set an agent's model to `google-gemini-cli/gemini-3.1-pro-preview`
2. Send a message
3. Before fix: `Unknown model: google-gemini-cli/gemini-3.1-pro-preview`
4. After fix: routes to Gemini CLI using `gemini-3-pro-preview` metadata as template
## Compatibility / Migration
- Backward compatible? Yes
- No config or migration changes required.
## Closes
Closes #21176
🤖 AI-Assisted: Yes (via OpenClaw)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Adds forward-compatibility support for `gemini-3.1-pro-preview` model in the `google-gemini-cli` provider. The model launched on 2026-02-19 and works via the standalone Gemini CLI but isn't yet in pi-ai's built-in catalog. The implementation clones `gemini-3-pro-preview` as a template using the same pattern established for other forward-compat models (`claude-opus-4-6`, `glm-5`). The change is minimal, isolated, and follows existing architectural patterns correctly.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The implementation follows an established pattern used for multiple other forward-compat models in the same file. The change is isolated to a single function that only affects the specific `google-gemini-cli/gemini-3.1-pro-preview` model combination. The template model (`gemini-3-pro-preview`) exists and is referenced throughout the codebase. No behavioral changes for other models or providers.
- No files require special attention
<sub>Last reviewed commit: d54bce3</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#21263: fix: add google-vertex support for Gemini 3.1 models
by pdd-cli · 2026-02-19
88.1%
#23424: feat: add Gemini 3.1 Pro Preview support (google-gemini-cli)
by hongchanroh · 2026-02-22
85.1%
#22899: fix(models): synthesize antigravity Gemini 3.1 pro high/low models
by Phineas1500 · 2026-02-21
84.8%
#11464: feat(models): add forward-compat fallback for gemini-3-pro-image
by ben-milanko · 2026-02-07
84.7%
#21257: # feat: add Gemini 3.1 Pro (low/high reasoning) model support
by GhadiSaab · 2026-02-19
84.3%
#23040: Upgrade default Google model to Gemini 3.1 Pro and add Venice catal...
by Clawborn · 2026-02-21
82.8%
#22337: fix(models): add fallback Gemini 3.1 Pro Preview catalog entry
by AIflow-Labs · 2026-02-21
82.4%
#13119: fix: add forward-compat for google-antigravity claude-opus-4-6 models
by sdb001 · 2026-02-10
81.9%
#16687: fix(antigravity): default to Gemini 3 Pro and remove broken depreca...
by vincentkoc · 2026-02-15
81.6%
#18697: fix: include forward-compat models in model catalog for allowlist val…
by dmitry-orabey · 2026-02-17
81.1%