#13361: fix(google-antigravity): add Opus 4.6 support and fix thinking.signature error for Claude thinking models
docker
agents
stale
Cluster:
OpenAI Model Fixes and Updates
## Summary
This PR makes two fixes for the `google-antigravity` provider:
1. **Adds Opus 4.6 model support** — Adds `google-antigravity` to the provider resolution in `resolveAntigravityModel()`, enabling Claude Opus 4.6 (thinking) models to work with the antigravity provider.
2. **Fixes `thinking.signature: Field required` error** — Normalizes thinking block signatures to include both `thinkingSignature` (internal) and `signature` (Anthropic API-compatible) fields, preventing API rejection on multi-turn conversations.
## Problem
### Opus 4.6 Not Recognized
When using `google-antigravity` with `claude-opus-4-6-thinking`, the model was not recognized because `resolveAntigravityModel()` did not include `google-antigravity` as a known provider.
### Thinking Signature Error
On the **second turn** of a conversation, previously-stored thinking blocks were replayed without a valid signature.
The `sanitizeAntigravityThinkingBlocks()` function normalizes signatures from various field names (`signature`, `thought_signature`, `thoughtSignature`) into `thinkingSignature`, but was **not setting the `signature` field**. This matters because the full request pipeline is:
```
OpenClaw session history
→ sanitizeAntigravityThinkingBlocks() [normalizes signatures]
→ pi-ai google-gemini-cli adapter (google-shared.js)
→ Google Cloud Code Assist API (Gemini format)
→ CCA Proxy → Anthropic Messages API (requires `signature` field)
```
When thinking blocks reached the CCA-to-Anthropic translation step without `signature`, the Anthropic API rejected them with:
```
thinking.signature: Field required
```
## Changes
### `src/agents/pi-embedded-runner/google.ts`
- **`resolveAntigravityModel()`**: Added `google-antigravity` provider check so Opus 4.6 thinking models are properly resolved.
- **`sanitizeAntigravityThinkingBlocks()`**: Now sets **both** `thinkingSignature` and `signature` on every valid thinking block, ensuring signatures survive the CCA-to-Anthropic translation.
## Testing
- Verified with `google-antigravity` provider and `claude-opus-4-6-thinking` model
- Multi-turn conversations work without the signature error
- Thinking blocks are correctly preserved with valid signatures
- Invalid/missing signatures cause thinking blocks to be safely dropped
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates the pi embedded runner’s Google/Antigravity path in two ways:
- In `sanitizeAntigravityThinkingBlocks()` it now normalizes valid thinking signatures onto both `thinkingSignature` (OpenClaw internal) and `signature` (Anthropic-compatible) so replayed thinking blocks aren’t rejected as `thinking.signature: Field required` on later turns.
- In model resolution, it broadens the Opus 4.6 forward-compat fallback so `google-antigravity` can resolve `claude-opus-4-6*` IDs using a cloned template model.
These changes fit into the existing transcript hygiene pipeline (`sanitizeSessionHistory` → provider adapters) and the forward-compat model fallback logic used when a provider’s model registry lags behind OpenClaw defaults.
<h3>Confidence Score: 3/5</h3>
- This PR is close, but there are a couple of integration/test gaps that could leave Opus 4.6 resolution or signature replay still failing in some environments.
- The signature normalization change is small and targeted, but tests currently don’t assert the new `signature` field (so the primary bugfix isn’t enforced). Also, the Opus 4.6 forward-compat lookup depends on how the model registry is keyed (provider and casing); as written, it still fail if templates aren’t registered under `google-antigravity` or if IDs are case-sensitive.
- src/agents/pi-embedded-runner/model.ts; src/agents/pi-embedded-runner.google-sanitize-thinking.test.ts
<!-- greptile_other_comments_section -->
<sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#13119: fix: add forward-compat for google-antigravity claude-opus-4-6 models
by sdb001 · 2026-02-10
85.5%
#16100: fix: convert unsigned thinking blocks to text to prevent signature ...
by claw-sylphx · 2026-02-14
83.7%
#17914: Resolve merge conflicts in PR #13361
by SovranAMR · 2026-02-16
80.6%
#15205: fix(models): normalize google-antigravity api field from google-gem...
by wboudy · 2026-02-13
79.8%
#23250: feat: add Sonnet 4.6 forward compat for google-antigravity
by Oceanswave · 2026-02-22
79.7%
#20620: feat: add anthropic/claude-opus-4-6 to XHIGH_MODEL_REFS
by chungjchris · 2026-02-19
79.6%
#15379: fix(antigravity): strip unsigned thinking blocks in agent loop via ...
by jg-noncelogic · 2026-02-13
79.1%
#19407: fix(agents): strip thinking blocks on cross-provider model switch (...
by lailoo · 2026-02-17
78.8%
#23424: feat: add Gemini 3.1 Pro Preview support (google-gemini-cli)
by hongchanroh · 2026-02-22
78.7%
#10097: fix: add empty thinking blocks to tool call messages when thinking is…
by cyxer000 · 2026-02-06
78.6%