From 3382d496e3986162a00333aa239752b3c132264f Mon Sep 17 00:00:00 2001 From: erio Date: Fri, 27 Feb 2026 20:56:33 +0800 Subject: [PATCH] refactor: remove unused detectClaudeMaxCacheBillingOutcomeForUsage function --- .../service/claude_max_cache_billing_policy.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/backend/internal/service/claude_max_cache_billing_policy.go b/backend/internal/service/claude_max_cache_billing_policy.go index 64696d4d..2381915e 100644 --- a/backend/internal/service/claude_max_cache_billing_policy.go +++ b/backend/internal/service/claude_max_cache_billing_policy.go @@ -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) {