Skip to content

fix: price Claude Opus 5.5 so its usage cost is not Unavailable - #354

Merged
chattymin merged 1 commit into
chattymin:mainfrom
cte13:fix/price-claude-opus-5-5
Sep 25, 2026
Merged

chattymin merged 1 commit into
chattymin:mainfrom
cte13:fix/price-claude-opus-5-5

Conversation

@cte13

@cte13 cte13 commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Summary

Claude Code usage on Claude Opus 5.5 (claude-opus-5-5) shows its cost as Unavailable: in the menu bar ($—), Home's today cost, the daily trend, and the Claude Code row. Since #289, only models with an exact row in ModelPricing.table get a price, and Opus 5.5 has none. Week and month totals still show dollars from days on older, priced models, so the problem looks partial.

This adds the exact row using the rates on the Claude pricing page, checked 2026-09-25:

Base input 5m cache write Cache hit Output
$4 / MTok $5 / MTok $0.20 / MTok $20 / MTok

Opus 5.5's cache-hit rate is 0.05× input, not the usual 0.1×.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation
  • Other:

Checklist

  • swift build and swift test pass locally (1269 tests, 0 failures)
  • PR title and description are written in English
  • No copyrighted assets, secrets, or private tooling references are committed (see CONTRIBUTING)
  • Tests were added or updated for this change: an exact-rate assertion, plus claude-opus-5-5 in testModelsReadFromProviderLogsAreAllPriced. Both fail without the new row.

🤖 Generated with Claude Code

https://claude.ai/code/session_01PNenigaFnwvcTs2kDND16Z

claude-opus-5-5 has no row in ModelPricing.table, so every Opus 5.5 request
falls to CostCoverage.unavailable and Claude Code cost renders as
"Unavailable" (menu bar $-, Home today, daily trend, provider row). Add the
exact row from the Claude pricing page ($4 input / $20 output, 5m cache write
$5, cache read $0.20 = 0.05x input rather than the usual 0.1x) and cover it
in testModelsReadFromProviderLogsAreAllPriced.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PNenigaFnwvcTs2kDND16Z
@chattymin
chattymin merged commit 832154a into chattymin:main Sep 25, 2026
2 checks passed
@chattymin

Copy link
Copy Markdown
Owner

Thank you for your contribution!

cte13 added a commit to cte13/PokeTokenBar-iOS that referenced this pull request Sep 25, 2026
chore: sync fork with upstream (15 PRs, incl. the fork's chattymin#353/chattymin#354/chattymin#355)
chattymin pushed a commit that referenced this pull request Sep 26, 2026
…361)

A model with no row in ModelPricing.table renders its cost as "Unavailable"
with no other trace, so a newly released model (Opus 5.5, fixed in #354) was
only noticed from a screenshot. Log each unpriced model identity once per
process from LocalUsageReader.Bucket.add ("Unpriced model: <id> — its cost
shows as Unavailable until ModelPricing.table has a row"). Rows whose source
already marks the cost as unavailable are not reported: a missing table row
is not the cause there.

Tests: the once-per-identity dedupe (normalized like the price lookup), and
the wiring observed through that dedupe, since AppLog is a no-op under swift
test. Fault injection: removing the report, or reporting source-unavailable
rows too, each fails the wiring test.


Claude-Session: https://claude.ai/code/session_01PNenigaFnwvcTs2kDND16Z

Co-authored-by: turtle hermit <4173875+cte13@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
donky-ey pushed a commit to donky-ey/PokeDexBar that referenced this pull request Oct 15, 2026
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.

2 participants