feat(ai): add claude-sonnet-4-6 to Antigravity, fix Claude thinking header detection, bump UA to 1.18.4
closes #1859
This commit is contained in:
@@ -2,6 +2,15 @@
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added `claude-sonnet-4-6` model for the `google-antigravity` provider ([#1859](https://github.com/badlogic/pi-mono/issues/1859)).
|
||||||
|
- Bumped default Antigravity User-Agent version to `1.18.4` ([#1859](https://github.com/badlogic/pi-mono/issues/1859)).
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed Antigravity Claude thinking beta header detection to use provider and model capability instead of `-thinking` suffix, so models like `claude-sonnet-4-6` receive the header correctly ([#1859](https://github.com/badlogic/pi-mono/issues/1859)).
|
||||||
|
|
||||||
## [0.56.2] - 2026-03-05
|
## [0.56.2] - 2026-03-05
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -1221,6 +1221,18 @@ async function generateModels() {
|
|||||||
contextWindow: 200000,
|
contextWindow: 200000,
|
||||||
maxTokens: 128000,
|
maxTokens: 128000,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "claude-sonnet-4-6",
|
||||||
|
name: "Claude Sonnet 4.6 (Antigravity)",
|
||||||
|
api: "google-gemini-cli",
|
||||||
|
provider: "google-antigravity",
|
||||||
|
baseUrl: ANTIGRAVITY_ENDPOINT,
|
||||||
|
reasoning: true,
|
||||||
|
input: ["text", "image"],
|
||||||
|
cost: { input: 3, output: 15, cacheRead: 0.3, cacheWrite: 3.75 },
|
||||||
|
contextWindow: 200000,
|
||||||
|
maxTokens: 64000,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: "gpt-oss-120b-medium",
|
id: "gpt-oss-120b-medium",
|
||||||
name: "GPT-OSS 120B Medium (Antigravity)",
|
name: "GPT-OSS 120B Medium (Antigravity)",
|
||||||
|
|||||||
@@ -2304,6 +2304,23 @@ export const MODELS = {
|
|||||||
contextWindow: 272000,
|
contextWindow: 272000,
|
||||||
maxTokens: 128000,
|
maxTokens: 128000,
|
||||||
} satisfies Model<"azure-openai-responses">,
|
} satisfies Model<"azure-openai-responses">,
|
||||||
|
"gpt-5.4-pro": {
|
||||||
|
id: "gpt-5.4-pro",
|
||||||
|
name: "GPT-5.4 Pro",
|
||||||
|
api: "azure-openai-responses",
|
||||||
|
provider: "azure-openai-responses",
|
||||||
|
baseUrl: "",
|
||||||
|
reasoning: true,
|
||||||
|
input: ["text", "image"],
|
||||||
|
cost: {
|
||||||
|
input: 30,
|
||||||
|
output: 180,
|
||||||
|
cacheRead: 0,
|
||||||
|
cacheWrite: 0,
|
||||||
|
},
|
||||||
|
contextWindow: 1050000,
|
||||||
|
maxTokens: 128000,
|
||||||
|
} satisfies Model<"azure-openai-responses">,
|
||||||
"o1": {
|
"o1": {
|
||||||
id: "o1",
|
id: "o1",
|
||||||
name: "o1",
|
name: "o1",
|
||||||
@@ -2880,7 +2897,7 @@ export const MODELS = {
|
|||||||
} satisfies Model<"openai-responses">,
|
} satisfies Model<"openai-responses">,
|
||||||
"gpt-5.3-codex": {
|
"gpt-5.3-codex": {
|
||||||
id: "gpt-5.3-codex",
|
id: "gpt-5.3-codex",
|
||||||
name: "GPT-5.3 Codex",
|
name: "GPT-5.3-Codex",
|
||||||
api: "openai-responses",
|
api: "openai-responses",
|
||||||
provider: "github-copilot",
|
provider: "github-copilot",
|
||||||
baseUrl: "https://api.individual.githubcopilot.com",
|
baseUrl: "https://api.individual.githubcopilot.com",
|
||||||
@@ -2893,7 +2910,25 @@ export const MODELS = {
|
|||||||
cacheRead: 0,
|
cacheRead: 0,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
contextWindow: 272000,
|
contextWindow: 400000,
|
||||||
|
maxTokens: 128000,
|
||||||
|
} satisfies Model<"openai-responses">,
|
||||||
|
"gpt-5.4": {
|
||||||
|
id: "gpt-5.4",
|
||||||
|
name: "GPT-5.4",
|
||||||
|
api: "openai-responses",
|
||||||
|
provider: "github-copilot",
|
||||||
|
baseUrl: "https://api.individual.githubcopilot.com",
|
||||||
|
headers: {"User-Agent":"GitHubCopilotChat/0.35.0","Editor-Version":"vscode/1.107.0","Editor-Plugin-Version":"copilot-chat/0.35.0","Copilot-Integration-Id":"vscode-chat"},
|
||||||
|
reasoning: true,
|
||||||
|
input: ["text", "image"],
|
||||||
|
cost: {
|
||||||
|
input: 0,
|
||||||
|
output: 0,
|
||||||
|
cacheRead: 0,
|
||||||
|
cacheWrite: 0,
|
||||||
|
},
|
||||||
|
contextWindow: 400000,
|
||||||
maxTokens: 128000,
|
maxTokens: 128000,
|
||||||
} satisfies Model<"openai-responses">,
|
} satisfies Model<"openai-responses">,
|
||||||
"grok-code-fast-1": {
|
"grok-code-fast-1": {
|
||||||
@@ -3395,6 +3430,23 @@ export const MODELS = {
|
|||||||
contextWindow: 200000,
|
contextWindow: 200000,
|
||||||
maxTokens: 64000,
|
maxTokens: 64000,
|
||||||
} satisfies Model<"google-gemini-cli">,
|
} satisfies Model<"google-gemini-cli">,
|
||||||
|
"claude-sonnet-4-6": {
|
||||||
|
id: "claude-sonnet-4-6",
|
||||||
|
name: "Claude Sonnet 4.6 (Antigravity)",
|
||||||
|
api: "google-gemini-cli",
|
||||||
|
provider: "google-antigravity",
|
||||||
|
baseUrl: "https://daily-cloudcode-pa.sandbox.googleapis.com",
|
||||||
|
reasoning: true,
|
||||||
|
input: ["text", "image"],
|
||||||
|
cost: {
|
||||||
|
input: 3,
|
||||||
|
output: 15,
|
||||||
|
cacheRead: 0.3,
|
||||||
|
cacheWrite: 3.75,
|
||||||
|
},
|
||||||
|
contextWindow: 200000,
|
||||||
|
maxTokens: 64000,
|
||||||
|
} satisfies Model<"google-gemini-cli">,
|
||||||
"gemini-3-flash": {
|
"gemini-3-flash": {
|
||||||
id: "gemini-3-flash",
|
id: "gemini-3-flash",
|
||||||
name: "Gemini 3 Flash (Antigravity)",
|
name: "Gemini 3 Flash (Antigravity)",
|
||||||
@@ -5454,6 +5506,23 @@ export const MODELS = {
|
|||||||
contextWindow: 272000,
|
contextWindow: 272000,
|
||||||
maxTokens: 128000,
|
maxTokens: 128000,
|
||||||
} satisfies Model<"openai-responses">,
|
} satisfies Model<"openai-responses">,
|
||||||
|
"gpt-5.4-pro": {
|
||||||
|
id: "gpt-5.4-pro",
|
||||||
|
name: "GPT-5.4 Pro",
|
||||||
|
api: "openai-responses",
|
||||||
|
provider: "openai",
|
||||||
|
baseUrl: "https://api.openai.com/v1",
|
||||||
|
reasoning: true,
|
||||||
|
input: ["text", "image"],
|
||||||
|
cost: {
|
||||||
|
input: 30,
|
||||||
|
output: 180,
|
||||||
|
cacheRead: 0,
|
||||||
|
cacheWrite: 0,
|
||||||
|
},
|
||||||
|
contextWindow: 1050000,
|
||||||
|
maxTokens: 128000,
|
||||||
|
} satisfies Model<"openai-responses">,
|
||||||
"o1": {
|
"o1": {
|
||||||
id: "o1",
|
id: "o1",
|
||||||
name: "o1",
|
name: "o1",
|
||||||
@@ -6172,6 +6241,23 @@ export const MODELS = {
|
|||||||
contextWindow: 272000,
|
contextWindow: 272000,
|
||||||
maxTokens: 128000,
|
maxTokens: 128000,
|
||||||
} satisfies Model<"openai-responses">,
|
} satisfies Model<"openai-responses">,
|
||||||
|
"gpt-5.4-pro": {
|
||||||
|
id: "gpt-5.4-pro",
|
||||||
|
name: "GPT-5.4 Pro",
|
||||||
|
api: "openai-responses",
|
||||||
|
provider: "opencode",
|
||||||
|
baseUrl: "https://opencode.ai/zen/v1",
|
||||||
|
reasoning: true,
|
||||||
|
input: ["text", "image"],
|
||||||
|
cost: {
|
||||||
|
input: 30,
|
||||||
|
output: 180,
|
||||||
|
cacheRead: 30,
|
||||||
|
cacheWrite: 0,
|
||||||
|
},
|
||||||
|
contextWindow: 1050000,
|
||||||
|
maxTokens: 128000,
|
||||||
|
} satisfies Model<"openai-responses">,
|
||||||
"kimi-k2.5": {
|
"kimi-k2.5": {
|
||||||
id: "kimi-k2.5",
|
id: "kimi-k2.5",
|
||||||
name: "Kimi K2.5",
|
name: "Kimi K2.5",
|
||||||
@@ -10350,9 +10436,9 @@ export const MODELS = {
|
|||||||
reasoning: true,
|
reasoning: true,
|
||||||
input: ["text"],
|
input: ["text"],
|
||||||
cost: {
|
cost: {
|
||||||
input: 0.3,
|
input: 0.38,
|
||||||
output: 1.4,
|
output: 1.9800000000000002,
|
||||||
cacheRead: 0.15,
|
cacheRead: 0.19,
|
||||||
cacheWrite: 0,
|
cacheWrite: 0,
|
||||||
},
|
},
|
||||||
contextWindow: 202752,
|
contextWindow: 202752,
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ const GEMINI_CLI_HEADERS = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Headers for Antigravity (sandbox endpoint) - requires specific User-Agent
|
// Headers for Antigravity (sandbox endpoint) - requires specific User-Agent
|
||||||
const DEFAULT_ANTIGRAVITY_VERSION = "1.18.3";
|
const DEFAULT_ANTIGRAVITY_VERSION = "1.18.4";
|
||||||
|
|
||||||
function getAntigravityHeaders() {
|
function getAntigravityHeaders() {
|
||||||
const version = process.env.PI_AI_ANTIGRAVITY_VERSION || DEFAULT_ANTIGRAVITY_VERSION;
|
const version = process.env.PI_AI_ANTIGRAVITY_VERSION || DEFAULT_ANTIGRAVITY_VERSION;
|
||||||
@@ -203,9 +203,8 @@ export function extractRetryDelay(errorText: string, response?: Response | Heade
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isClaudeThinkingModel(modelId: string): boolean {
|
function needsClaudeThinkingBetaHeader(model: Model<"google-gemini-cli">): boolean {
|
||||||
const normalized = modelId.toLowerCase();
|
return model.provider === "google-antigravity" && model.id.startsWith("claude-") && model.reasoning;
|
||||||
return normalized.includes("claude") && normalized.includes("thinking");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function isGemini3ProModel(modelId: string): boolean {
|
function isGemini3ProModel(modelId: string): boolean {
|
||||||
@@ -379,7 +378,7 @@ export const streamGoogleGeminiCli: StreamFunction<"google-gemini-cli", GoogleGe
|
|||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
Accept: "text/event-stream",
|
Accept: "text/event-stream",
|
||||||
...headers,
|
...headers,
|
||||||
...(isClaudeThinkingModel(model.id) ? { "anthropic-beta": CLAUDE_THINKING_BETA_HEADER } : {}),
|
...(needsClaudeThinkingBetaHeader(model) ? { "anthropic-beta": CLAUDE_THINKING_BETA_HEADER } : {}),
|
||||||
...options?.headers,
|
...options?.headers,
|
||||||
};
|
};
|
||||||
const requestBodyJson = JSON.stringify(requestBody);
|
const requestBodyJson = JSON.stringify(requestBody);
|
||||||
|
|||||||
@@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Added `claude-sonnet-4-6` model for the `google-antigravity` provider ([#1859](https://github.com/badlogic/pi-mono/issues/1859)).
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fixed `/new` leaving startup header content, including the changelog, visible after starting a fresh session ([#1880](https://github.com/badlogic/pi-mono/issues/1880))
|
- Fixed `/new` leaving startup header content, including the changelog, visible after starting a fresh session ([#1880](https://github.com/badlogic/pi-mono/issues/1880))
|
||||||
|
|||||||
Reference in New Issue
Block a user