fix(tui): bill Anthropic cache-write tokens at published rates (#4318)#4348
fix(tui): bill Anthropic cache-write tokens at published rates (#4318)#4348knqiufan wants to merge 1 commit into
Conversation
|
Thanks @knqiufan for taking the time to contribute. This repository is observing a maintainer-managed PR intake gate in dry-run mode, so this pull request is staying open. This note helps maintainers prepare the allowlist before any enforcement is considered. Please read |
Keep cache-creation usage separate from cache-miss and wire CurrencyPricing.cache_write so TUI cost estimates stop undercounting Anthropic/Qwen write premiums (Hmbown#4318). Signed-off-by: knqiufan <knqiufan@foxmail.com>
7927645 to
f0a617b
Compare
Summarize the underwater interaction system, treatment/motion independence, compact-room fixes, footer notice ownership, ASCII tier, and localization parity work in the 0.8.68 changelog section, and credit the harvested community work: Korean locale (PR #4347 @moduvoice), Anthropic schema sanitization (PR #4346 @qinlinwang), Anthropic cache-write pricing (PR #4348 @knqiufan), NetBSD bindgen (PR #4349 @ci4ic4), and the #4208 copy-pollution report (@eugenicum).
|
Thanks @knqiufan — your contribution landed in
Closing this PR now that the code is on If you want to land more work and would prefer your future PRs merge cleanly without a harvest step, the |
Summary
cache_creation_input_tokensasUsage::prompt_cache_write_tokensinstead of folding them into cache-miss.CurrencyPricingwithcache_write_per_millionand publish 5-minute write rates for Anthropic/Qwen rows (e.g. claude-fable-5 at 12.50).token_usage_for_pricingand turn-cost math so cache-write is no longer hardcoded to 0, fixing undercounted cost estimates.Closes #4318
Testing
cargo fmt --all -- --check(viacargo fmt -p codewhale-tui)cargo clippy --workspace --all-targets --all-featurescargo test -p codewhale-tui --bin codewhale-tui --locked pricing::testssession_usage_cache_*/ turn-metadata testscargo test --workspace --all-featuresChecklist