fix(antigravity): add image passthrough for Claude models

The wrapInCloudCodeEnvelopeForClaude function converts Claude message
blocks to Antigravity/Gemini parts format but only handles text,
tool_use, and tool_result types. Image blocks (type: 'image' with
base64 source) are silently dropped, causing Claude models routed
through Antigravity to never receive image content.

This adds handling for image blocks, converting them to inlineData
format (the same format the Gemini path already uses successfully).

Tested: Claude via Antigravity now correctly receives and describes
image content that was previously invisible.
This commit is contained in:
AndrewDragonIV
2026-04-01 23:40:07 +03:00
parent 49c9eaa6e1
commit afefee2357

View File

@@ -432,6 +432,13 @@ function wrapInCloudCodeEnvelopeForClaude(model, claudeRequest, credentials = nu
for (const block of msg.content) {
if (block.type === "text") {
parts.push({ text: block.text });
} else if (block.type === "image" && block.source) {
parts.push({
inlineData: {
mimeType: block.source.media_type,
data: block.source.data,
},
});
} else if (block.type === "tool_use") {
parts.push({
functionCall: {