Skip to content

Show pricing coverage for partial Gateway cost estimates #87

Open

Description

@NOirBRight

Summary

The Gateway summary presents the cost calculated from a small priced subset as if it covered all usage. When most requests lack pricing, the result is a partial sum but visually reads as the total estimated cost.

Live reproduction

The running snapshot reported:

  • 176,092,215 total tokens;
  • 1,452 requests;
  • 1,448 requests missing model pricing;
  • only 4 requests contributing to cost;
  • displayed estimated cost: approximately $0.05.

This produces an implausible effective rate of about $0.00027 per million tokens. The backend cost_label states that 1,448 requests are missing pricing, but the primary UI amount does not expose coverage.

Expected behavior

A partial estimate must not be presented as a complete total.

Recommended states:

  • fully priced: $X.XX estimated;
  • partially priced: $X.XX partial estimate · 4/1452 requests priced;
  • no priced requests: Cost unavailable;
  • missing usage and missing pricing shown as separate coverage dimensions.

Acceptance criteria

  • Return explicit priced_requests, unpriced_requests, priced token totals, and coverage percentage.
  • Distinguish no estimate, partial estimate, and complete estimate in the UI.
  • Never format unknown/unpriced usage as $0.00.
  • Show coverage in the summary card and accessible details.
  • Cost charts and grouped summaries carry the same semantics.
  • Filters and date windows recompute cost and coverage over the same events.
  • Add regression tests for 0%, partial, and 100% pricing coverage.

Related

Relevant code

  • src-tauri/src/gateway/telemetry.rs
  • frontend/src/components/StackedUsageChartShell.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingready-for-agentFully specified, ready for an AFK agentwayfinder:taskWayfinder implementation task

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions