← Back to PRs

#13361: fix(google-antigravity): add Opus 4.6 support and fix thinking.signature error for Claude thinking models

by SovranAMR open 2026-02-10 11:55 View on GitHub →
docker agents stale
## 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