Skip to content
This repository was archived by the owner on Feb 28, 2026. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ Antigravity provides access to Claude models via `gemini-claude-*` model names.
- `gemini-claude-sonnet-4-5` - Claude Sonnet 4.5
- `gemini-claude-sonnet-4-5-thinking` - Claude Sonnet 4.5 with thinking
- `gemini-claude-opus-4-5-thinking` - Claude Opus 4.5 with thinking
- `gemini-claude-sonnet-4-6` - Claude Sonnet 4.6
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a sonnet variant 4.6? I guess that's an AI slop or something.

- `gemini-claude-sonnet-4-6-thinking` - Claude Sonnet 4.6 with thinking
- `gemini-claude-opus-4-6-thinking` - Claude Opus 4.6 with thinking

### Interleaved Thinking Support

Expand Down Expand Up @@ -462,4 +465,3 @@ Turn 5: Switch to Gemini → Claude's thinking removed, Gemini Turn 3 restored
- **Conversation text preserved**: Only thinking blocks are removed; actual response text flows through normally
- **Same-provider continuity**: Each family maintains its own thinking history across model switches


17 changes: 17 additions & 0 deletions src/plugin/request.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@ describe("Interleaved Thinking Headers", () => {
expect(headers.get("anthropic-beta")).toBe("interleaved-thinking-2025-05-14");
});

test("supports Claude 4.6 thinking models (aliases and adds header)", async () => {
const url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-claude-sonnet-4-6-thinking:streamGenerateContent";

const result = await prepareAntigravityRequest(
url,
{ method: "POST", body: JSON.stringify({ contents: [] }) },
"dummy-token",
"dummy-project"
);

const headers = result.init.headers as Headers;
expect(headers.get("anthropic-beta")).toBe("interleaved-thinking-2025-05-14");

const body = JSON.parse(result.init.body as string);
expect(body.model).toBe("claude-sonnet-4-6-thinking");
});

test("does NOT add header for non-thinking claude models", async () => {
const url = "https://generativelanguage.googleapis.com/v1beta/models/gemini-claude-sonnet-4-5:streamGenerateContent";

Expand Down
8 changes: 7 additions & 1 deletion src/plugin/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,13 @@ export function createSseTransformStream(onError?: (body: GeminiApiBody) => Gemi


function resolveModelName(rawModel: string): string {
// Antigravity exposes Claude via Gemini-style model IDs like:
// `gemini-claude-sonnet-4-6-thinking`, but the Code Assist backend expects
// `claude-sonnet-4-6-thinking`. Normalize all current/future Claude proxy IDs.
if (rawModel.startsWith("gemini-claude-")) {
return rawModel.replace(/^gemini-/, "");
}

const aliased = MODEL_ALIASES[rawModel];
if (aliased) {
return aliased;
Expand Down Expand Up @@ -804,4 +811,3 @@ export async function transformAntigravityResponse(
return response;
}
}