Skip to content

[TASK] Refactor pricing lookup fallback for dated model ids #1155

Closed as not planned

Description

@edenreich

Summary

Pricing lookups miss dated model ids. With judge.model: anthropic/claude-haiku-4-5-20251001, /stats counts the judge's tokens but shows no cost, because the pricing table has no entry for the dated id. Any provider that versions model ids by date has the same gap, so cost totals under-report.

Add a fallback that strips a trailing date suffix (-YYYYMMDD) before the pricing lookup, or otherwise matches dated ids to their base entry.

Acceptance Criteria

  • CalculateCost resolves a dated model id to its undated pricing entry when no exact entry exists
  • /stats and session_stats show a cost for anthropic/claude-haiku-4-5-20251001
  • A table test covers exact, dated-fallback, and unknown ids

Activity

  1. added
    refactor
    on Sep 2, 2026
  2. added theissue type on Sep 2, 2026
  3. moved this to Todo in 2026on Sep 2, 2026
  4. edenreich commented on Sep 2, 2026

    @edenreich
    ContributorAuthor

    Premise no longer holds: the CLI's static pricing table was removed in #941, and prices now come from the gateway's /v1/models?include=pricing. The gateway's community pricing table already has an explicit entry for anthropic/claude-haiku-4-5-20251001 (since gateway v0.35.0), so the dated id resolves without a suffix-stripping fallback. If /stats still shows no judge cost, that is a separate bug (usage recorded before the model list is fetched, or a gateway older than v0.35.0); verify with curl 'http://localhost:8080/v1/models?include=pricing' before reopening.

  5. moved this from Todo to Done in 2026on Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    refactor

    Type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions