#23250: feat: add Sonnet 4.6 forward compat for google-antigravity
commands
agents
size: S
Cluster:
OpenAI Model Fixes and Updates
## Summary
Google Cloud Code Assist (google-antigravity) already serves `claude-sonnet-4-6` and `claude-sonnet-4-6-thinking` — the Antigravity IDE exposes them — but pi-ai's `models.generated.js` has not been updated to include these entries yet. This means configuring `google-antigravity/claude-sonnet-4-6-thinking` in openclaw fails with "Unknown model".
This PR adds `resolveAntigravitySonnet46ForwardCompatModel`, mirroring the existing `resolveAntigravityOpus46ForwardCompatModel` pattern. It clones the registered `claude-sonnet-4-5-thinking` / `claude-sonnet-4-5` templates with the 4.6 model IDs so users can use Sonnet 4.6 on antigravity without waiting for a pi-ai catalog update.
### What changed
- Added `ANTIGRAVITY_SONNET_46_*` constants (model IDs, template IDs) following the existing Opus 4.6 pattern
- Added `resolveAntigravitySonnet46ForwardCompatModel` function handling both thinking and non-thinking variants, with dash and dot model ID formats
- Wired it into the `resolveForwardCompatModel` chain
### Why forward compat instead of a models.generated.js update
The model registry is generated from pi-ai's catalog. Until that catalog is updated, forward compat is the standard pattern used by openclaw for new model variants (see Opus 4.6, GPT 5.3 Codex, GLM-5, Anthropic Sonnet 4.6 on native provider).
## Test plan
- [ ] Configure `google-antigravity/claude-sonnet-4-6-thinking` as primary or fallback model
- [ ] Verify model resolves without "Unknown model" error
- [ ] Verify API calls succeed against Google Cloud Code Assist endpoint
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
This PR adds forward compatibility support for Claude Sonnet 4.6 models on the `google-antigravity` provider, mirroring the existing Opus 4.6 pattern. The implementation correctly handles both dash (`claude-sonnet-4-6`) and dot (`claude-sonnet-4.6`) model ID formats, as well as thinking and non-thinking variants.
**Key changes:**
- Added Sonnet 4.6 model ID constants and template fallbacks
- Implemented `resolveAntigravitySonnet46ForwardCompatModel` following the Opus pattern
- Wired the resolver into the forward-compat chain
**Issue found:**
- Missing `ANTIGRAVITY_SONNET_46_FORWARD_COMPAT_CANDIDATES` export that's needed for `openclaw models list` to show these models (see inline comment)
The core resolution logic is solid and matches the established pattern. Once the export is added and `list.registry.ts` is updated to consume it, Sonnet 4.6 will work seamlessly.
<h3>Confidence Score: 3/5</h3>
- Safe to merge after addressing the missing export for model listing
- The implementation correctly follows the established Opus 4.6 pattern and the resolution logic will work. However, the missing `ANTIGRAVITY_SONNET_46_FORWARD_COMPAT_CANDIDATES` export means these models won't appear in `openclaw models list` output, which is a discrepancy with how Opus 4.6 works and likely unintended.
- `src/agents/model-forward-compat.ts` needs the export added, and `src/commands/models/list.registry.ts` should be updated to consume it
<sub>Last reviewed commit: 95b7319</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#13119: fix: add forward-compat for google-antigravity claude-opus-4-6 models
by sdb001 · 2026-02-10
86.7%
#19533: fix: allow forward-compat models in buildAllowedModelSet
by Anthony-g-dev · 2026-02-17
85.8%
#20095: fix(model-forward-compat): extend claude-sonnet-4.6 forward-compat ...
by SeeYangZhi · 2026-02-18
83.2%
#16891: fix(models): generic opus-4-6 forward-compat for all providers
by battman21 · 2026-02-15
83.0%
#18697: fix: include forward-compat models in model catalog for allowlist val…
by dmitry-orabey · 2026-02-17
80.3%
#13361: fix(google-antigravity): add Opus 4.6 support and fix thinking.sign...
by SovranAMR · 2026-02-10
79.7%
#12220: fix: forward-compat models now respect user-configured contextWindow
by Batuhan4 · 2026-02-09
79.5%
#10831: fix(agents): set Opus 4.6 context window to 1M in forward-compat fa...
by slawt · 2026-02-07
78.1%
#21181: fix(models): add gemini-3.1-pro-preview forward-compat for google-g...
by Mellowambience · 2026-02-19
78.1%
#22899: fix(models): synthesize antigravity Gemini 3.1 pro high/low models
by Phineas1500 · 2026-02-21
77.6%