Repository navigation
Description
Before submitting
- I searched existing issues and did not find a duplicate (checked
#40349which fixed-orchestratorand1537onmain, and#31298which covers missing.dbfiles; this issue covers the distinctrememberModel()poisoning,MODEL_IDSsuppression, mismatchedidxjoin, and remaining unmapped variants still present onmain). - I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Have multiple Antigravity conversation
.dbfiles under~/.gemini/antigravity-cli/conversations/where a numericmodelId(e.g.1532forgemini-4-neon,1417forgemini-4-argon,1318forgemini-3.8-flash) appears with its bare model name in protobuf field 19 (gemini-4-neon) on most rows, and falls back to its display name in field 21 (Gemini 4 Neon (High)-> normalized togemini-4-neon-high) on at least one row. - Have any step record whose usage entry lacks a matching
gen_metadatarow (or hasstep.idx >= generations.length). - Open Usage -> Cost (24h or 30d).
Expected behavior
- Effort-suffix variations of the same base model (
gemini-4-neonvsgemini-4-neon-high) do not poison the learnedmodelId -> modelNamemapping tonull. - Step records resolve to their concrete model name and are priced using LiteLLM rates.
- Remaining Antigravity routing/variant slugs (
gemini-3.8-flash-n,gemini-pro-orchestrator/Orchestrator (Carbon),gemini-4-argon-r,gemini-4-argon-trial) map to their base model rates.
Actual behavior
Four compounding bugs in apps/server/src/provider/Drivers/antigravityUsageReader.ts (all verified still present on current main) cause Antigravity records — heavily impacting subagent/orchestrator workloads — to be charted as Unpriced ($0.00):
-
rememberModel()poisonsmodelId -> nullon effort-suffix variation (antigravityUsageReader.ts:179-182onmain):function rememberModel(models: Map<number, string | null>, id: number, model: string | null) { const previous = models.get(id); models.set(id, previous === undefined || previous === model ? model : null); }
In Antigravity's protobufs, field 19 carries the bare model name (
gemini-4-neon) and field 21 carries the display name with effort (Gemini 4 Neon (High)->gemini-4-neon-high). Whenever even a single row across all scanned DBs omits field 19 and falls back to field 21,rememberModelsees two different strings for the samemodelIdand permanently poisonsmodels.get(id)tonull.- Across 369 real DBs, 9 of 17 model IDs were poisoned to
null:1318,1320,1417,1418,1427,1437,1526,1532,1533. - Example:
modelId = 1532hadgemini-4-neonon 9,542 rows andgemini-4-neon-highon just 4 rows — those 4 rows poisonedmodels.get(1532) = null.
- Across 369 real DBs, 9 of 17 model IDs were poisoned to
-
learned === nullalso suppresses the staticMODEL_IDSfallback (antigravityUsageReader.ts:568-575onmain):const learned = models.get(candidate.modelId); const fallback = learned === null ? undefined : MODEL_IDS[candidate.modelId];
Because
learned === nullclearsfallback, even IDs explicitly listed inMODEL_IDS(1318,1320,1417,1418) fall through to unpricedantigravity-model-<id>. -
usageCandidates()joinsstepstogen_metadataon mismatchedidxspaces (antigravityUsageReader.ts:349-364onmain):const generationModels = new Map(generations.map(({ idx, entry }) => [idx, entry])); ... const generation = source === "step" ? generationModels.get(idx) : undefined;
steps.idxis the conversation step index (0..3333+, including user/tool/thinking steps), whilegen_metadata.idxis the 0-based generation sequence (0..1133). Looking upgenerationModels.get(step.idx)matches an unrelated generation or returnsundefinedoncestep.idx >= generations.length, exposing step-only usage rows to bugs (1) and (2). -
Remaining unmapped Antigravity variant slugs & numeric IDs still missing on
main(follow-up to#40349):gemini-3.8-flash-n(modelId1318/1320, 237.3M tokens in 30d) -> should rate asgemini-3.8-flashgemini-pro-orchestrator(modelId1667, displayOrchestrator (Carbon), 82.9M tokens) -> should rate asgemini-4-carbongemini-4-argon-r(1417, 14.6M tokens) &gemini-4-argon-trial(1417/1418, 5.4M tokens) -> should rate asgemini-4-argon- Missing static
MODEL_IDS:1427/1437(gemini-4-carbon),1525/1526/1527(gemini-4-hydrogen),1532/1533(gemini-4-neon),1667(gemini-pro-orchestrator),1669(gemini-4-hydrogen-orchestrator).
Impact
Major degradation or frequent failure
Version or commit
0.1.11 (59651c1761f6c63e9b6056839067066968e6a406), bugs 1-4 verified still present on current main
Environment
Ubuntu 26.04 + Windows 11, T3 Code 0.1.11, Antigravity CLI (agy)
Logs or stack traces
Observed modelId -> raw protobuf strings across 369 local Antigravity .db files:
modelId=1318: {"gemini-3.8-flash-n": 2149, "Gemini 3.8 Flash (High)": 4079, "gemini-3.8-flash": 1928} -> learned=null
modelId=1320: {"gemini-3.8-flash-n": 2, "Gemini 3.8 Flash (Low)": 127, "gemini-3.8-flash": 125} -> learned=null
modelId=1417: {"gemini-4-argon-trial": 41, "Gemini 4 Argon (High)": 164, "gemini-4-argon-r": 122} -> learned=null
modelId=1418: {"gemini-4-argon-trial": 49, "Gemini 4 Argon (Medium)": 50} -> learned=null
modelId=1427: {"gemini-4-carbon": 1727, "Gemini 4 Carbon (High)": 1729} -> learned=null
modelId=1437: {"gemini-4-carbon": 2510, "Gemini 4 Carbon (Medium)": 2511} -> learned=null
modelId=1526: {"gemini-4-hydrogen": 1354, "Gemini 4 Hydrogen (Medium)": 1355} -> learned=null
modelId=1532: {"gemini-4-neon": 9542, "Gemini 4 Neon (High)": 9546} -> learned=null
modelId=1533: {"gemini-4-neon": 2709, "Gemini 4 Neon (Medium)": 2711} -> learned=null
modelId=1667: {"gemini-pro-orchestrator": 459, "Orchestrator (Carbon)": 460}
modelId=1669: {"gemini-flash-worker-agy": 6736, "Gemini 4 Hydrogen (Orchestrator)": 6736}
Resulting unpriced fallback records in 30d window:
antigravity-model-1437: 10.52M tokens (unpriced)
antigravity-model-1532: 9.19M tokens (unpriced; 3.12M in last 24h alone)
antigravity-model-1427: 7.90M tokens (unpriced)
antigravity-model-1667: 3.89M tokens (unpriced)
antigravity-model-1537: 3.22M tokens (unpriced)
antigravity-model-1417: 2.67M tokens (unpriced)
antigravity-model-1533: 2.07M tokens (unpriced)
antigravity-model-1526: 0.78M tokens (unpriced)
antigravity-model-1318: 0.78M tokens (unpriced)
Workaround
None without manually adding custom price overrides for every antigravity-model-<id> and unmapped variant slug in Usage settings.
Suggested fix
- In
rememberModel(), compare normalized base models viaantigravityRateModel(model)(sogemini-4-neonandgemini-4-neon-highagree ongemini-4-neoninstead of poisoning tonull). - Do not suppress
MODEL_IDS[candidate.modelId]when observed variants share the same base model. - Remove the cross-table
generationModels.get(step.idx)lookup (rely on usage dedupe key merging + learned/staticmodelIdinstead). - Extend
antigravityRateModel()andMODEL_IDSforgemini-3.8-flash-n,gemini-pro-orchestrator,gemini-4-argon-r,gemini-4-argon-trial, and the newer numeric IDs above.
Activity