What happens
costevent.Event.Micros() = math.Round(CostUSD * 1e6) in costevent.go rounds sub-half-micro costs to 0. The event is still marked priced. After aggregation, CostMicros can be 0 while PricedRequests > 0. renderCostSummary then printsCOST $0.00 — the same output as a genuinely-free priced call.
This can occur for models like Anthropic Haiku's ~$0.25/M input rate, where a 1-token priced call is $2.5e-7 and rounds to 0 micros.
Behavior impact
Small-but-real spend reads as free in the usage-graph total. The per-event cell is unaffected (it renders through formatUSDCell's <$0.0001 floor against the raw CostUSD, not against the rounded micros).
Proposed fix
Add a PositiveCostRequests counter that sources from the pre-rounding CostUSD > 0 predicate:
costevent.eventCost — new predicate exposed
usage.Counts + Counts.Add — new field, folded at every accumulation site
renderCostSummary — render <$0.01 when CostMicros == 0 && PositiveCostRequests > 0
Do not clamp Micros() to 1 — it changes the documented rounding semantics and lies about the underlying figure.
Ref #1000 (addressed by #1042)
Assisted-By: Claude (Anthropic AI) noreply@anthropic.com
What happens
costevent.Event.Micros() = math.Round(CostUSD * 1e6)in costevent.go rounds sub-half-micro costs to0. The event is still marked priced. After aggregation,CostMicroscan be0whilePricedRequests > 0.renderCostSummarythen printsCOST $0.00— the same output as a genuinely-free priced call.This can occur for models like Anthropic Haiku's ~$0.25/M input rate, where a 1-token priced call is $2.5e-7 and rounds to
0micros.Behavior impact
Small-but-real spend reads as free in the usage-graph total. The per-event cell is unaffected (it renders through
formatUSDCell's<$0.0001floor against the rawCostUSD, not against the rounded micros).Proposed fix
Add a
PositiveCostRequestscounter that sources from the pre-roundingCostUSD > 0predicate:costevent.eventCost— new predicate exposedusage.Counts+Counts.Add— new field, folded at every accumulation siterenderCostSummary— render<$0.01whenCostMicros == 0 && PositiveCostRequests > 0Do not clamp
Micros()to1— it changes the documented rounding semantics and lies about the underlying figure.Ref #1000 (addressed by #1042)
Assisted-By: Claude (Anthropic AI) noreply@anthropic.com