Skip to content

Commit f03e526

Browse files
test(antigravity): cover Claude Opus 5.5 through the loader
The parser test called the mapping helpers directly, so it did not prove that real Antigravity rows load with the right model and cost. Extend the production report fixture with a row that only carries model ID 1402 and a row that stores `model_placeholder_m402`, and assert both load as `claude-opus-5-5` with a non-zero cost and no missing-pricing warning. The snapshot now includes them in the daily, weekly, monthly and session reports. Co-authored-by: viniciusdsandrade <[email protected]>
1 parent 8852b4b commit f03e526

2 files changed

Lines changed: 196 additions & 27 deletions

File tree

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

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,14 @@ mod tests {
139139
"gemini-3.6-flash": {
140140
"input_cost_per_token": 0.000003,
141141
"output_cost_per_token": 0.000004
142+
},
143+
"claude-opus-5-5": {
144+
"input_cost_per_token": 0.000005,
145+
"output_cost_per_token": 0.000025
142146
}
143147
}"#
144148
),
145-
2
149+
3
146150
);
147151
pricing
148152
}
@@ -682,8 +686,55 @@ mod tests {
682686
&[],
683687
&[],
684688
);
689+
create_database(
690+
&fixture.path("third/conversations/third.db"),
691+
&[
692+
(
693+
1,
694+
metadata_blob(
695+
None,
696+
Some(UsageFixture {
697+
model_id: Some(1402),
698+
input_tokens: 300,
699+
total_output_tokens: 60,
700+
visible_output_tokens: 60,
701+
response_id: Some("snapshot-opus-id"),
702+
..UsageFixture::default()
703+
}),
704+
Some((1_781_481_600, 0)),
705+
&[],
706+
),
707+
),
708+
(
709+
2,
710+
metadata_blob(
711+
Some("model_placeholder_m402"),
712+
Some(UsageFixture {
713+
input_tokens: 400,
714+
total_output_tokens: 80,
715+
visible_output_tokens: 80,
716+
response_id: Some("snapshot-opus-placeholder"),
717+
..UsageFixture::default()
718+
}),
719+
Some((1_781_481_660, 0)),
720+
&[],
721+
),
722+
),
723+
],
724+
&[],
725+
&[],
726+
);
685727
let pricing = snapshot_pricing();
686728
let entries = load_from_fixture_with_pricing(&fixture, true, &pricing);
729+
for response_id in ["snapshot-opus-id", "snapshot-opus-placeholder"] {
730+
let entry = entries
731+
.iter()
732+
.find(|entry| entry.data.message.id.as_deref() == Some(response_id))
733+
.unwrap();
734+
assert_eq!(entry.model.as_deref(), Some("claude-opus-5-5"));
735+
assert!(entry.cost > 0.0);
736+
assert!(entry.missing_pricing_model.is_none());
737+
}
687738
let periods = [
688739
crate::cli::AgentReportKind::Daily,
689740
crate::cli::AgentReportKind::Weekly,

‎rust/adapters/antigravity/src/snapshots/ccusage_adapter_antigravity__loader__tests__snapshots_production_reports_for_focused_periods.snap‎

Lines changed: 144 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,37 @@ expression: reports
4949
"outputTokens": 50,
5050
"totalCost": 0.0008,
5151
"totalTokens": 250
52+
},
53+
{
54+
"cacheCreationTokens": 0,
55+
"cacheReadTokens": 0,
56+
"date": "2026-06-15",
57+
"inputTokens": 700,
58+
"modelBreakdowns": [
59+
{
60+
"cacheCreationTokens": 0,
61+
"cacheReadTokens": 0,
62+
"cost": 0.007,
63+
"inputTokens": 700,
64+
"modelName": "claude-opus-5-5",
65+
"outputTokens": 140
66+
}
67+
],
68+
"modelsUsed": [
69+
"claude-opus-5-5"
70+
],
71+
"outputTokens": 140,
72+
"totalCost": 0.007,
73+
"totalTokens": 840
5274
}
5375
],
5476
"totals": {
5577
"cacheCreationTokens": 5,
5678
"cacheReadTokens": 20,
57-
"inputTokens": 300,
58-
"outputTokens": 80,
59-
"totalCost": 0.000987,
60-
"totalTokens": 415
79+
"inputTokens": 1000,
80+
"outputTokens": 220,
81+
"totalCost": 0.007987000000000001,
82+
"totalTokens": 1255
6183
}
6284
},
6385
"table": [
@@ -86,6 +108,19 @@ expression: reports
86108
"output": 50,
87109
"period": "2026-06-08",
88110
"total": 250
111+
},
112+
{
113+
"cacheCreate": 0,
114+
"cacheRead": 0,
115+
"cost": 0.007,
116+
"firstColumn": "Date",
117+
"input": 700,
118+
"models": [
119+
"claude-opus-5-5"
120+
],
121+
"output": 140,
122+
"period": "2026-06-15",
123+
"total": 840
89124
}
90125
]
91126
},
@@ -117,8 +152,16 @@ expression: reports
117152
{
118153
"cacheCreationTokens": 0,
119154
"cacheReadTokens": 0,
120-
"inputTokens": 200,
155+
"inputTokens": 900,
121156
"modelBreakdowns": [
157+
{
158+
"cacheCreationTokens": 0,
159+
"cacheReadTokens": 0,
160+
"cost": 0.007,
161+
"inputTokens": 700,
162+
"modelName": "claude-opus-5-5",
163+
"outputTokens": 140
164+
},
122165
{
123166
"cacheCreationTokens": 0,
124167
"cacheReadTokens": 0,
@@ -129,21 +172,22 @@ expression: reports
129172
}
130173
],
131174
"modelsUsed": [
132-
"gemini-3.6-flash"
175+
"gemini-3.6-flash",
176+
"claude-opus-5-5"
133177
],
134178
"month": "2026-06",
135-
"outputTokens": 50,
136-
"totalCost": 0.0008,
137-
"totalTokens": 250
179+
"outputTokens": 190,
180+
"totalCost": 0.0078000000000000005,
181+
"totalTokens": 1090
138182
}
139183
],
140184
"totals": {
141185
"cacheCreationTokens": 5,
142186
"cacheReadTokens": 20,
143-
"inputTokens": 300,
144-
"outputTokens": 80,
145-
"totalCost": 0.000987,
146-
"totalTokens": 415
187+
"inputTokens": 1000,
188+
"outputTokens": 220,
189+
"totalCost": 0.007987000000000001,
190+
"totalTokens": 1255
147191
}
148192
},
149193
"table": [
@@ -163,15 +207,16 @@ expression: reports
163207
{
164208
"cacheCreate": 0,
165209
"cacheRead": 0,
166-
"cost": 0.0008,
210+
"cost": 0.0078000000000000005,
167211
"firstColumn": "Month",
168-
"input": 200,
212+
"input": 900,
169213
"models": [
170-
"gemini-3.6-flash"
214+
"gemini-3.6-flash",
215+
"claude-opus-5-5"
171216
],
172-
"output": 50,
217+
"output": 190,
173218
"period": "2026-06",
174-
"total": 250
219+
"total": 1090
175220
}
176221
]
177222
},
@@ -227,15 +272,40 @@ expression: reports
227272
"sessionId": "second",
228273
"totalCost": 0.0008,
229274
"totalTokens": 250
275+
},
276+
{
277+
"cacheCreationTokens": 0,
278+
"cacheReadTokens": 0,
279+
"firstActivity": "2026-06-15T00:00:00.000Z",
280+
"inputTokens": 700,
281+
"lastActivity": "2026-06-15T00:01:00.000Z",
282+
"modelBreakdowns": [
283+
{
284+
"cacheCreationTokens": 0,
285+
"cacheReadTokens": 0,
286+
"cost": 0.007,
287+
"inputTokens": 700,
288+
"modelName": "claude-opus-5-5",
289+
"outputTokens": 140
290+
}
291+
],
292+
"modelsUsed": [
293+
"claude-opus-5-5"
294+
],
295+
"outputTokens": 140,
296+
"projectPath": "Antigravity",
297+
"sessionId": "third",
298+
"totalCost": 0.007,
299+
"totalTokens": 840
230300
}
231301
],
232302
"totals": {
233303
"cacheCreationTokens": 5,
234304
"cacheReadTokens": 20,
235-
"inputTokens": 300,
236-
"outputTokens": 80,
237-
"totalCost": 0.000987,
238-
"totalTokens": 415
305+
"inputTokens": 1000,
306+
"outputTokens": 220,
307+
"totalCost": 0.007987000000000001,
308+
"totalTokens": 1255
239309
}
240310
},
241311
"table": [
@@ -264,6 +334,19 @@ expression: reports
264334
"output": 50,
265335
"period": "second",
266336
"total": 250
337+
},
338+
{
339+
"cacheCreate": 0,
340+
"cacheRead": 0,
341+
"cost": 0.007,
342+
"firstColumn": "Session",
343+
"input": 700,
344+
"models": [
345+
"claude-opus-5-5"
346+
],
347+
"output": 140,
348+
"period": "third",
349+
"total": 840
267350
}
268351
]
269352
},
@@ -272,10 +355,10 @@ expression: reports
272355
"totals": {
273356
"cacheCreationTokens": 5,
274357
"cacheReadTokens": 20,
275-
"inputTokens": 300,
276-
"outputTokens": 80,
277-
"totalCost": 0.000987,
278-
"totalTokens": 415
358+
"inputTokens": 1000,
359+
"outputTokens": 220,
360+
"totalCost": 0.007987000000000001,
361+
"totalTokens": 1255
279362
},
280363
"weekly": [
281364
{
@@ -321,6 +404,28 @@ expression: reports
321404
"totalCost": 0.0008,
322405
"totalTokens": 250,
323406
"week": "2026-06-08"
407+
},
408+
{
409+
"cacheCreationTokens": 0,
410+
"cacheReadTokens": 0,
411+
"inputTokens": 700,
412+
"modelBreakdowns": [
413+
{
414+
"cacheCreationTokens": 0,
415+
"cacheReadTokens": 0,
416+
"cost": 0.007,
417+
"inputTokens": 700,
418+
"modelName": "claude-opus-5-5",
419+
"outputTokens": 140
420+
}
421+
],
422+
"modelsUsed": [
423+
"claude-opus-5-5"
424+
],
425+
"outputTokens": 140,
426+
"totalCost": 0.007,
427+
"totalTokens": 840,
428+
"week": "2026-06-15"
324429
}
325430
]
326431
},
@@ -350,6 +455,19 @@ expression: reports
350455
"output": 50,
351456
"period": "2026-06-08",
352457
"total": 250
458+
},
459+
{
460+
"cacheCreate": 0,
461+
"cacheRead": 0,
462+
"cost": 0.007,
463+
"firstColumn": "Week",
464+
"input": 700,
465+
"models": [
466+
"claude-opus-5-5"
467+
],
468+
"output": 140,
469+
"period": "2026-06-15",
470+
"total": 840
353471
}
354472
]
355473
}

0 commit comments

Comments
 (0)