Skip to content

fix: tell an unreported LLM call from a cheap one - #73

Merged
goldbarth merged 1 commit into
mainfrom
72-run-metrics-understate-token-cost-when-a-provider-does-not-report-usage
Jul 30, 2026
Merged

goldbarth merged 1 commit into
mainfrom
72-run-metrics-understate-token-cost-when-a-provider-does-not-report-usage

Conversation

@goldbarth

@goldbarth goldbarth commented Jul 30, 2026 •

Copy link
Copy Markdown
Owner

What does this PR do?

Why?

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Refactor / internal
  • Breaking change

Checklist

  • The project builds and tests pass
  • Code follows the formatting in .editorconfig
  • I've added or updated tests where it makes sense
  • I've updated documentation where relevant
  • No secrets or API keys are included in this change

UsageDetails counts are nullable, so a missing count and a real zero
are different states. Collapsing both with `?? 0` made a run whose
provider never reported usage read as an exact, low token total.

Keep the nullables until RunMetrics, count the incomplete calls next
to the tokens, and mark the total as a lower bound when any exist.

Closes #72
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run metrics understate token cost when a provider does not report usage

1 participant