fix(tui): restore session cost when live pricing is unverifiable (#5241) - #5402
Draft
Hmbown wants to merge 2 commits into
Draft
fix(tui): restore session cost when live pricing is unverifiable (#5241)#5402Hmbown wants to merge 2 commits into
Hmbown wants to merge 2 commits into
Conversation
Session cost stayed unverified_live_pricing when a live catalog row could not be verified and Fireworks/OpenCode Zen had no bundled or hand rates. Do not treat Models.dev live overlays as rates (capabilities only) and do not pretend a control-plane /session 503 is a healthy price list. Add provider-docs fallback rates for Fireworks deepseek-v4-flash (including flash-0731), kimi-k3, and deepseek-v4-pro, plus OpenCode Zen deepseek-v4-flash. Verified provider-live rows still win. Agent assistance: Cursor Cloud agent used for implementation. Co-authored-by: Hunter Bown <Hmbown@users.noreply.github.com>
The Models.dev leftover-cost regression used 1M input tokens on gpt-5.5, which is UnrepresentedTier rather than a catalog-source check. Price 10K tokens so the assertion reads the bundled $5/M row. Verified: cargo fmt; cargo test -p codewhale-tui --lib --locked pricing::tests (59 passed), live_catalog_origin_prefers_per_provider, cost_report_distinguishes_bundled_fallback_from_no_usable_fallback. Agent assistance: Cursor Cloud agent used for implementation and verification. Co-authored-by: Hunter Bown <Hmbown@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5241. Session cost no longer stays
unverified_live_pricingforever when live pricing cannot be verified (including the reporter path wherehttps://api.codewhale.net/sessionreturns 503control_plane_not_attached).Honest path:
/session503 as a healthy live price listcostis ignored)/modelsrows still win when the endpoint returns usable dataBundled fallback routes (USD per 1M, cache-read / input / output):
accounts/fireworks/models/deepseek-v4-flashanddeepseek-v4-flash-0731— $0.028 / $0.14 / $0.28accounts/fireworks/models/kimi-k3— $0.30 / $3.00 / $15.00accounts/fireworks/models/deepseek-v4-pro(default Fireworks route, same honesty gap) — $0.145 / $1.74 / $3.48deepseek-v4-flash— $0.028 / $0.14 / $0.28These are Fireworks Standard / OpenCode Zen PAYG published cards, not first-party DeepSeek's $0.0028 cache-hit.
Testing
cargo fmt --allcargo test -p codewhale-tui --lib --locked pricing::tests— 59 passedlive_catalog_origin_prefers_per_provider_over_models_devcost_report_distinguishes_bundled_fallback_from_no_usable_fallbackcargo clippy --workspace --all-targets --all-features --lockedcargo test --workspace --all-features --lockedChecklist
Harvest notes (v098-final local lane)
unverified_live_pricingwhen control-plane/sessionis 503 / unattached; usable bundled rates for common Fireworks/Zen routes; live wins when healthy; models.dev is not a rate source.costinvented from the capabilities catalog; pretendingapi.codewhale.net/session503 is a healthy live price list; first-party DeepSeek $0.0028 cache-hit on Fireworks/Zen.main(5ac75add); issue Pricing endpoint returns 503 - all sessions show unverified_live_pricing #5241 by @alitvak69; no community PR to harvest.