diff --git a/src/handlers/step.ts b/src/handlers/step.ts index 3bf155c..feade3c 100644 --- a/src/handlers/step.ts +++ b/src/handlers/step.ts @@ -65,7 +65,7 @@ function accumulateTotals( if (!existing) return const next: SessionTotals = { ...existing, - tokens: existing.tokens + tokens, + tokens: tokens > 0 ? tokens : existing.tokens, cost: existing.cost + cost, messages: existing.messages + (incrementMessages ? 1 : 0), }