fix(antigravity): opus 4.6 forward-compat model + thinking signature sanitization bypass (#14218)

Two fixes for Google Antigravity (Cloud Code Assist) reliability:

1. Forward-compat model fallback: pi-ai's model registry doesn't include
   claude-opus-4-6-thinking. Add resolveAntigravityOpus46ForwardCompatModel()
   that clones the opus-4-5 template so the correct api ("google-gemini-cli")
   and baseUrl are preserved. Fixes #13765.

2. Fix thinking.signature rejection: The API returns Claude thinking blocks
   without signatures, then rejects them on replay. The existing sanitizer
   strips unsigned blocks, but the orphaned-user-message path in attempt.ts
   bypassed it by reading directly from disk. Now applies
   sanitizeAntigravityThinkingBlocks at that code path.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
jg-noncelogic
2026-02-12 09:01:28 -05:00
committed by GitHub
parent d85150357f
commit 6f74786384
4 changed files with 84 additions and 2 deletions

View File

@@ -59,7 +59,7 @@ function isValidAntigravitySignature(value: unknown): value is string {
return ANTIGRAVITY_SIGNATURE_RE.test(trimmed);
}
function sanitizeAntigravityThinkingBlocks(messages: AgentMessage[]): AgentMessage[] {
export function sanitizeAntigravityThinkingBlocks(messages: AgentMessage[]): AgentMessage[] {
let touched = false;
const out: AgentMessage[] = [];
for (const msg of messages) {