Token usage: keep cache/reasoning split, count only recorded steps, cost only when positive; captures fixture, docs and notes

This commit is contained in:
2026-11-03 22:16:49 +00:00
parent aa948bdfe4
commit 3227d61caf
19 changed files with 447 additions and 61 deletions
@@ -98,7 +98,7 @@ void main() {
expect(rows.firstWhere((row) => row.label == 'Size on disk').value, '5 MB');
expect(
rows.firstWhere((row) => row.label == 'Tokens').value,
'123 (100 in, 23 out)',
'123 · 100 in, 23 out',
);
expect(rows.firstWhere((row) => row.label == 'Cost').value, '\$0.50');
expect(rows.firstWhere((row) => row.label == 'Retry of').value, 'run 12');
@@ -30,7 +30,7 @@ void main() {
final facts = detailVisitFacts(_reported);
expect(
facts,
contains((label: 'Tokens', value: '1.5M (1.2M in, 300K out)')),
contains((label: 'Tokens', value: '1.5M · 1.2M in, 300K out')),
);
expect(facts, contains((label: 'Cost', value: '\$0.42')));
final none = detailVisitFacts(_unreported);