refactor: remove unused detectClaudeMaxCacheBillingOutcomeForUsage function

This commit is contained in:
erio
2026-02-27 20:56:33 +08:00
parent e0b4b00dc1
commit 3382d496e3

View File

@@ -13,23 +13,6 @@ type claudeMaxCacheBillingOutcome struct {
Simulated bool
}
// detectClaudeMaxCacheBillingOutcomeForUsage only returns whether Claude Max policy
// should influence downstream override decisions. It does not mutate usage.
func detectClaudeMaxCacheBillingOutcomeForUsage(usage ClaudeUsage, parsed *ParsedRequest, group *Group, model string) claudeMaxCacheBillingOutcome {
var out claudeMaxCacheBillingOutcome
if !shouldApplyClaudeMaxBillingRulesForUsage(group, model, parsed) {
return out
}
if hasCacheCreationTokens(usage) {
// Upstream already returned cache creation usage; keep original usage.
return out
}
if shouldSimulateClaudeMaxUsageForUsage(usage, parsed) {
out.Simulated = true
}
return out
}
func applyClaudeMaxCacheBillingPolicyToUsage(usage *ClaudeUsage, parsed *ParsedRequest, group *Group, model string, accountID int64) claudeMaxCacheBillingOutcome {
var out claudeMaxCacheBillingOutcome
if usage == nil || !shouldApplyClaudeMaxBillingRulesForUsage(group, model, parsed) {