Skip to content

Commit a11b60f

Browse files
cursoragentShobitm
andcommitted
fix(antigravity): map model ID 1050 to gemini-3.1-flash-lite
Antigravity's internal sub-agent model MODEL_PLACEHOLDER_M50 (enum 1050) is labeled Gemini 3.1 Flash Lite by the platform. Map the numeric ID and the placeholder name so those steps are priced instead of reported as model_placeholder_m50. ID 1277 stays unmapped because its model is not publicly identifiable. Co-authored-by: Shobitm <[email protected]>
1 parent 7e25fe3 commit a11b60f

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

‎rust/adapters/antigravity/src/parser.rs‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,7 @@ fn model_name_from_id(model_id: u64) -> String {
867867
1072 => "gemini-3.6-flash-medium".to_string(),
868868
1073 => "gemini-3.6-flash-low".to_string(),
869869
1417 => "gemini-4-argon".to_string(),
870+
1050 => "gemini-3.1-flash-lite".to_string(),
870871
1_000.. => format!("model_placeholder_m{}", model_id - 1_000),
871872
_ => format!("antigravity-model-{model_id}"),
872873
}
@@ -919,6 +920,7 @@ fn normalize_antigravity_model(raw: &str) -> Option<String> {
919920
"model_placeholder_m72" => "gemini-3.6-flash-medium",
920921
"model_placeholder_m73" => "gemini-3.6-flash-low",
921922
"model_placeholder_m417" => "gemini-4-argon",
923+
"model_placeholder_m50" => "gemini-3.1-flash-lite",
922924
"model_placeholder_m26" => "claude-opus-4-6",
923925
"model_placeholder_m35" => "claude-sonnet-4-6",
924926
"model_placeholder_m36" | "model_placeholder_m37" | "model_placeholder_m16" => {
@@ -1551,6 +1553,12 @@ mod tests {
15511553
"Gemini 4 Argon",
15521554
"gemini-4-argon",
15531555
),
1556+
(
1557+
1050,
1558+
"model_placeholder_m50",
1559+
"Gemini 3.1 Flash Lite",
1560+
"gemini-3.1-flash-lite",
1561+
),
15541562
];
15551563

15561564
for (model_id, placeholder, display_name, expected) in cases {
@@ -1570,6 +1578,36 @@ mod tests {
15701578
);
15711579
}
15721580

1581+
#[test]
1582+
fn flash_lite_subagent_model_is_priced_and_unknown_ids_stay_traceable() {
1583+
let pricing = PricingMap::load_embedded();
1584+
let usage = TokenUsageRaw {
1585+
input_tokens: 1_000_000,
1586+
..TokenUsageRaw::default()
1587+
};
1588+
let flash_lite = model_name_from_id(1050);
1589+
assert!(
1590+
missing_antigravity_pricing(&flash_lite, None, usage, CostMode::Calculate, &pricing)
1591+
.is_none()
1592+
);
1593+
assert!(
1594+
calculate_antigravity_cost(
1595+
&flash_lite,
1596+
None,
1597+
usage,
1598+
TimestampMs::UNIX_EPOCH,
1599+
CostMode::Calculate,
1600+
&pricing,
1601+
) > 0.0
1602+
);
1603+
1604+
assert_eq!(model_name_from_id(1277), "model_placeholder_m277");
1605+
assert_eq!(
1606+
normalize_antigravity_model("model_placeholder_m277").as_deref(),
1607+
Some("model_placeholder_m277")
1608+
);
1609+
}
1610+
15731611
#[test]
15741612
fn newer_gemini_effort_variants_fall_back_to_base_pricing() {
15751613
assert_eq!(

0 commit comments

Comments
 (0)