Skip to content

给 Claude 系列模型添加价格 - #20

Merged
Max-Samson merged 2 commits into
Max-Samson:mainfrom
ChthoIly:claude-support
Nov 9, 2026
Merged

Max-Samson merged 2 commits into
Max-Samson:mainfrom
ChthoIly:claude-support

Conversation

@ChthoIly

@ChthoIly ChthoIly commented Nov 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

- Built-in Anthropic Claude standard API rates (USD/1M, verified
  2026-11-05): Fable 5.1/5, Mythos 5.1/5, Opus 5.5/5/4.8/4.7/4.6/4.5/4.1/4,
  Sonnet 5.5/5/4.6/4.5/4, Haiku 4.5. Flat across peak/off-peak; CNY at the
  fixed 6.76 rate. Haiku 5.5 is not listed (prompt-length tiered pricing).
- Optional `cacheWrite` rate (5-minute TTL write price), also accepted in
  pricing.json; absent → cache-miss rate (DeepSeek unchanged).
- normalizeModelId: lower-case, strip `anthropic/`, dotted Claude versions
  → hyphens; shared by host resolver, pricing.json and client snapshot.
- matchPricingKey: exact, else longest prefix (order-independent); Claude
  keys only accept a dated snapshot suffix (-YYYYMMDD / -latest), so
  unlisted versions and -fast/-batch/Bedrock variants never borrow a
  sibling's rate.
- Unlisted models whose id contains `claude` (incl. Bedrock ids and display
  names) resolve to zero rates with `unpriced: true` instead of the
  deepseek-flash fallback. pricingFor()/estimateCost() change accordingly.
- UI: totals with unpriced rounds show `≥` plus a panel note; the $0/1M
  price line and $0 compaction cost are hidden; anomaly detection skips
  unpriced rounds.
- Docs: README/README_ZH Claude section, CHANGELOG Unreleased entry
  (incl. DSH 0.2.2-rc.1 compatibility check), ARCHITECTURE resolver row.
@ChthoIly

ChthoIly commented Nov 6, 2026

Copy link
Copy Markdown
Contributor Author

@al-alsace /review

@Max-Samson Max-Samson left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔁 This review has been superseded. See the latest review.

RoundBars ignored ChartCost.unpriced, so rounds on unlisted Claude
models rendered a $0 value label, a "total $0" aria label and a zero
cost in token-mode tooltips. Label them Unpriced and add rendering
regression tests.

@Max-Samson Max-Samson left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔁 This review has been superseded. See the latest review.

@ChthoIly
ChthoIly requested a review from Max-Samson November 7, 2026 08:25
@ChthoIly

ChthoIly commented Nov 7, 2026

Copy link
Copy Markdown
Contributor Author

@Max-Samson 看看有没有问题

@Max-Samson Max-Samson left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review: ✅ APPROVE

Typecheck and all 72 tests pass, plus additional host/client parity and compaction checks. Claude rates match the official pricing table. The previously reported unpriced-chart issue is fixed and regression-tested.

Verdict: APPROVE — No actionable issues found in pricing resolution, cost propagation, aggregation, or rendering.

No issues found. Code looks good!


Automated review by RomeOS Code Review · commit f08f895

@Max-Samson
Max-Samson merged commit f456f9d into Max-Samson:main Nov 9, 2026
2 checks passed
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