fix: surface unknown pricing instead of misleading $0.0000 - #175
Open
alexdim wants to merge 2 commits into
Open
Conversation
alexdim
force-pushed
the
fix/fu10-cost-unknown-pricing
branch
from
August 10, 2026 23:35
4ed89f1 to
cd2bb15
Compare
dirac-run
requested changes
Aug 11, 2026
dirac-run
left a comment
Owner
There was a problem hiding this comment.
hasPricing() only means that at least one price is known; it does not mean the model is free. Since totalCost starts at zero, this labels ordinary paid models as FREE until their first billed response. Please render a neutral $0.0000 state for known nonzero pricing and reserve FREE for explicitly zero-priced models. A regression test for a paid model with totalCost === 0 would cover this.
added 2 commits
August 12, 2026 14:21
calculateApiCostInternal silently returned 0 when inputPrice/outputPrice were missing, making unknown pricing indistinguishable from genuinely free models. This caused the UI to show a misleading $0.0000 for custom OpenAI-compatible endpoints, uncached LiteLLM, Dify, and other unpriced providers. Return undefined when no pricing data is present; keep returning 0 for explicitly-zero prices (genuinely free local models). Remove hardcoded inputPrice/outputPrice: 0 from openAiModelInfoSaneDefaults and liteLlmModelInfoSaneDefaults so unknown models fall through to undefined. Export hasPricing to @shared/api so the webview can use it. TaskHeader now renders three states: $X.XX (charged), FREE (explicitly free model), n/a (unknown pricing). HistoryViewItem shows — instead of $0.0000. FU-10 · private/review/RCA-COST-000.md
hasPricing means prices exist, not free. Paid models with totalCost 0 were labeled FREE until first bill. - isFreeModel: inputPrice===0 && outputPrice===0 - getCostLabel: n/a | FREE | $X.XXXX ($0.0000 unpaid) - regression: paid + totalCost 0 → $0.0000
alexdim
force-pushed
the
fix/fu10-cost-unknown-pricing
branch
from
August 12, 2026 11:23
cd2bb15 to
b87cf07
Compare
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.
What
isFreeModel: true only wheninputPrice === 0 && outputPrice === 0getCostLabel:n/a|FREE|$X.XXXX(paid with no usage →$0.0000)totalCost === 0→$0.0000, notFREEundefinedwhen pricing unknown (not0)Why
hasPricing()means prices exist, not free. Paid models started attotalCost === 0and were labeledFREEuntil the first billed response.Notes / Caveats
TaskHeader.tsx(also on master) left alonesrc/shared/storage/types.tson master (delta 0)Verification
src/utils/cost.test.ts: 21 passinggetCostLabel.test.ts: 5 passingUser test
$0.0000, notFREEinputPrice/outputPrice0) →FREEn/a$X.XXXXAlexandros Salapatas