fix (#1361)
Co-authored-by: Ansh7473 <Ansh7473@users.noreply.github.com>
This commit is contained in:
@@ -53,13 +53,14 @@ const PROVIDER_MODELS = {
|
||||
{ id: "glm-4.7" },
|
||||
],
|
||||
ag: [
|
||||
{ id: "gemini-3-pro-low" },
|
||||
{ id: "gemini-3-pro-high" },
|
||||
{ id: "gemini-3-flash-agent" },
|
||||
{ id: "gemini-3.5-flash-low" },
|
||||
{ id: "gemini-pro-agent" },
|
||||
{ id: "gemini-3.1-pro-low" },
|
||||
{ id: "claude-sonnet-4-6" },
|
||||
{ id: "claude-opus-4-6-thinking" },
|
||||
{ id: "gpt-oss-120b-medium" },
|
||||
{ id: "gemini-3-flash" },
|
||||
{ id: "gemini-2.5-flash" },
|
||||
{ id: "claude-sonnet-4-5" },
|
||||
{ id: "claude-sonnet-4-5-thinking" },
|
||||
{ id: "claude-opus-4-5-thinking" },
|
||||
],
|
||||
gh: [
|
||||
{ id: "gpt-5" },
|
||||
|
||||
@@ -92,12 +92,14 @@ export const PROVIDER_MODELS = {
|
||||
{ id: "iflow-rome-30ba3b", name: "iFlow ROME" },
|
||||
],
|
||||
ag: [ // Antigravity - special case: models call different backends
|
||||
{ id: "gemini-3.1-pro-high", name: "Gemini 3 Pro High" },
|
||||
{ id: "gemini-3.1-pro-low", name: "Gemini 3 Pro Low" },
|
||||
{ id: "gemini-3-flash", name: "Gemini 3 Flash", thinking: false }, // AG strips thinking for this model
|
||||
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6" },
|
||||
{ id: "claude-opus-4-6-thinking", name: "Claude Opus 4.6 Thinking" },
|
||||
{ id: "gpt-oss-120b-medium", name: "GPT OSS 120B Medium" },
|
||||
{ id: "gemini-3-flash-agent", name: "Gemini 3.5 Flash (High)" },
|
||||
{ id: "gemini-3.5-flash-low", name: "Gemini 3.5 Flash (Medium)" },
|
||||
{ id: "gemini-pro-agent", name: "Gemini 3.1 Pro (High)" },
|
||||
{ id: "gemini-3.1-pro-low", name: "Gemini 3.1 Pro (Low)" },
|
||||
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6 (Thinking)" },
|
||||
{ id: "claude-opus-4-6-thinking", name: "Claude Opus 4.6 (Thinking)" },
|
||||
{ id: "gpt-oss-120b-medium", name: "GPT-OSS 120B (Medium)" },
|
||||
{ id: "gemini-3-flash", name: "Gemini 3 Flash", thinking: false }, // command model; AG strips thinking
|
||||
],
|
||||
gh: [ // GitHub Copilot - OpenAI models
|
||||
{ id: "gpt-3.5-turbo", name: "GPT-3.5 Turbo" },
|
||||
|
||||
@@ -379,12 +379,14 @@ async function getAntigravityUsage(accessToken, providerSpecificData, proxyOptio
|
||||
if (data.models) {
|
||||
// Filter only recommended/important models (must match PROVIDER_MODELS ag ids)
|
||||
const importantModels = [
|
||||
'claude-opus-4-6-thinking',
|
||||
'claude-sonnet-4-6',
|
||||
'gemini-3.1-pro-high',
|
||||
'gemini-3-flash-agent',
|
||||
'gemini-3.5-flash-low',
|
||||
'gemini-pro-agent',
|
||||
'gemini-3.1-pro-low',
|
||||
'gemini-3-flash',
|
||||
'claude-sonnet-4-6',
|
||||
'claude-opus-4-6-thinking',
|
||||
'gpt-oss-120b-medium',
|
||||
'gemini-3-flash',
|
||||
];
|
||||
|
||||
for (const [modelKey, info] of Object.entries(data.models)) {
|
||||
|
||||
@@ -30,19 +30,25 @@ const URL_PATTERNS = {
|
||||
|
||||
// Synonym map: rawModel from request → canonical alias key in mitmAlias DB
|
||||
const MODEL_SYNONYMS = {
|
||||
antigravity: { "gemini-default": "gemini-3-flash" },
|
||||
antigravity: {
|
||||
"gemini-default": "gemini-3-flash-agent",
|
||||
"gemini-3.1-pro-high": "gemini-pro-agent",
|
||||
"gemini-3-pro-high": "gemini-pro-agent",
|
||||
"gemini-3-pro-low": "gemini-3.1-pro-low",
|
||||
},
|
||||
};
|
||||
|
||||
// Pattern fallback: rawModel regex → canonical alias key (when exact + prefix match fail)
|
||||
// Order matters: more specific patterns first. Catches AG renamed variants (e.g. gemini-pro-agent)
|
||||
const MODEL_PATTERNS = {
|
||||
antigravity: [
|
||||
{ match: /flash/i, alias: "gemini-3-flash" },
|
||||
{ match: /pro.*low|low.*pro/i, alias: "gemini-3.1-pro-low" },
|
||||
{ match: /gemini.*pro|pro.*gemini/i, alias: "gemini-3.1-pro-high" },
|
||||
{ match: /opus/i, alias: "claude-opus-4-6-thinking" },
|
||||
{ match: /sonnet|claude/i, alias: "claude-sonnet-4-6" },
|
||||
{ match: /gpt.*oss|oss/i, alias: "gpt-oss-120b-medium" },
|
||||
{ match: /flash.*low|low.*flash|flash.*medium|medium.*flash/i, alias: "gemini-3.5-flash-low" },
|
||||
{ match: /flash.*agent|agent.*flash|flash/i, alias: "gemini-3-flash-agent" },
|
||||
{ match: /pro.*low|low.*pro/i, alias: "gemini-3.1-pro-low" },
|
||||
{ match: /gemini.*pro|pro.*gemini/i, alias: "gemini-pro-agent" },
|
||||
{ match: /opus/i, alias: "claude-opus-4-6-thinking" },
|
||||
{ match: /sonnet|claude/i, alias: "claude-sonnet-4-6" },
|
||||
{ match: /gpt.*oss|oss/i, alias: "gpt-oss-120b-medium" },
|
||||
],
|
||||
};
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ function getMappedModel(tool, model) {
|
||||
// Prefix match fallback
|
||||
const prefixKey = Object.keys(aliases).find(k => k && aliases[k] && (lookup.startsWith(k) || k.startsWith(lookup)));
|
||||
if (prefixKey) return aliases[prefixKey];
|
||||
// Pattern fallback: catches AG renamed variants (e.g. gemini-pro-agent → gemini-3.1-pro-high)
|
||||
// Pattern fallback: catches AG renamed variants (e.g. deprecated pro IDs → gemini-pro-agent)
|
||||
const patterns = MODEL_PATTERNS?.[tool] || [];
|
||||
for (const { match, alias } of patterns) {
|
||||
if (match.test(lookup) && aliases[alias]) return aliases[alias];
|
||||
|
||||
@@ -8,15 +8,16 @@ export const MITM_TOOLS = {
|
||||
description: "Google Antigravity IDE with MITM",
|
||||
configType: "mitm",
|
||||
mitmDomain: "daily-cloudcode-pa.googleapis.com",
|
||||
modelAliases: ["claude-opus-4-6-thinking", "claude-sonnet-4-6", "gemini-3-flash", "gpt-oss-120b-medium", "gemini-3-pro-high", "gemini-3-pro-low", "gemini-pro-agent"],
|
||||
modelAliases: ["gemini-3-flash-agent", "gemini-3.5-flash-low", "gemini-pro-agent", "gemini-3.1-pro-low", "claude-sonnet-4-6", "claude-opus-4-6-thinking", "gpt-oss-120b-medium", "gemini-3-flash"],
|
||||
defaultModels: [
|
||||
{ id: "gemini-pro-agent", name: "Gemini Pro Agent (AG v1.23+ Agent Mode)", alias: "gemini-pro-agent" },
|
||||
{ id: "gemini-3.1-pro-high", name: "Gemini 3.1 Pro High", alias: "gemini-3.1-pro-high" },
|
||||
{ id: "gemini-3.1-pro-low", name: "Gemini 3.1 Pro Low", alias: "gemini-3.1-pro-low" },
|
||||
{ id: "gemini-3-flash", name: "Gemini 3 Flash / Default", alias: "gemini-3-flash" },
|
||||
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6", alias: "claude-sonnet-4-6" },
|
||||
{ id: "claude-opus-4-6-thinking", name: "Claude Opus 4.6 Thinking", alias: "claude-opus-4-6-thinking" },
|
||||
{ id: "gpt-oss-120b-medium", name: "GPT OSS 120B Medium", alias: "gpt-oss-120b-medium" },
|
||||
{ id: "gemini-3-flash-agent", name: "Gemini 3.5 Flash (High) / Default", alias: "gemini-3-flash-agent" },
|
||||
{ id: "gemini-3.5-flash-low", name: "Gemini 3.5 Flash (Medium)", alias: "gemini-3.5-flash-low" },
|
||||
{ id: "gemini-pro-agent", name: "Gemini 3.1 Pro (High)", alias: "gemini-pro-agent" },
|
||||
{ id: "gemini-3.1-pro-low", name: "Gemini 3.1 Pro (Low)", alias: "gemini-3.1-pro-low" },
|
||||
{ id: "claude-sonnet-4-6", name: "Claude Sonnet 4.6 (Thinking)", alias: "claude-sonnet-4-6" },
|
||||
{ id: "claude-opus-4-6-thinking", name: "Claude Opus 4.6 (Thinking)", alias: "claude-opus-4-6-thinking" },
|
||||
{ id: "gpt-oss-120b-medium", name: "GPT-OSS 120B (Medium)", alias: "gpt-oss-120b-medium" },
|
||||
{ id: "gemini-3-flash", name: "Gemini 3 Flash (Command)", alias: "gemini-3-flash" },
|
||||
],
|
||||
},
|
||||
copilot: {
|
||||
|
||||
@@ -60,6 +60,9 @@ export const MODEL_PRICING = {
|
||||
"gemini-3-pro-preview": { input: 2.00, output: 12.00, cached: 0.25, reasoning: 18.00, cache_creation: 2.00 },
|
||||
"gemini-3.1-pro-low": { input: 2.00, output: 12.00, cached: 0.25, reasoning: 18.00, cache_creation: 2.00 },
|
||||
"gemini-3.1-pro-high": { input: 4.00, output: 18.00, cached: 0.50, reasoning: 27.00, cache_creation: 4.00 },
|
||||
"gemini-pro-agent": { input: 4.00, output: 18.00, cached: 0.50, reasoning: 27.00, cache_creation: 4.00 },
|
||||
"gemini-3-flash-agent": { input: 0.50, output: 3.00, cached: 0.03, reasoning: 4.50, cache_creation: 0.50 },
|
||||
"gemini-3.5-flash-low": { input: 0.50, output: 3.00, cached: 0.03, reasoning: 4.50, cache_creation: 0.50 },
|
||||
"gemini-3-flash": { input: 0.50, output: 3.00, cached: 0.03, reasoning: 4.50, cache_creation: 0.50 },
|
||||
"gemini-2.5-pro": { input: 2.00, output: 12.00, cached: 0.25, reasoning: 18.00, cache_creation: 2.00 },
|
||||
"gemini-2.5-flash": { input: 0.30, output: 2.50, cached: 0.03, reasoning: 3.75, cache_creation: 0.30 },
|
||||
|
||||
Reference in New Issue
Block a user