fix(billing): correct tiered billing settlement and edge cases
- quota.go: add missing SettleBilling call in PostWssConsumeQuota - text_quota.go: gate InjectTieredBillingInfo on tieredBillingApplied bool instead of tieredResult != nil, so fallback billing still logs metadata - price.go: remove quotaBeforeGroup == 0 from freeModel condition to avoid bypassing settlement for output-only expressions - tiered_settle.go: split cc/cc1h subtraction using UsageSemantic to distinguish OpenAI vs Claude cache creation token formats - pricing.go: only set BillingMode when a non-empty expression exists - useModelPricingEditorState.js: only write billing_mode when finalBillingExpr is non-empty
This commit is contained in:
+2
-2
@@ -323,8 +323,8 @@ func updatePricing() {
|
||||
pricing.AudioCompletionRatio = &audioCompletionRatio
|
||||
}
|
||||
if billingMode := billing_setting.GetBillingMode(model); billingMode == "tiered_expr" {
|
||||
pricing.BillingMode = billingMode
|
||||
if expr, ok := billing_setting.GetBillingExpr(model); ok {
|
||||
if expr, ok := billing_setting.GetBillingExpr(model); ok && expr != "" {
|
||||
pricing.BillingMode = billingMode
|
||||
pricing.BillingExpr = expr
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user