fix: remove unused billing attribution helper

This commit is contained in:
dailingfei
2026-06-15 17:16:26 +08:00
parent 8ce7b9a8f6
commit b63b411654
@@ -3,7 +3,6 @@ package service
import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"github.com/tidwall/gjson"
@@ -71,11 +70,11 @@ func extractFirstUserText(body []byte) string {
return first
}
// buildBillingAttributionBlockJSON 构造 system 数组的 billing attribution block。
// buildBillingAttributionText 构造 system 数组的 billing attribution 文本。
//
// 形态严格对齐真实 Claude Code CLI:
//
// {"type":"text","text":"x-anthropic-billing-header: cc_version=2.1.161.{fp}; cc_entrypoint=cli; cch=00000;"}
// x-anthropic-billing-header: cc_version=2.1.161.{fp}; cc_entrypoint=cli; cch=00000;
//
// cch=00000 是签名占位符,由 signBillingHeaderCCH 在 buildUpstreamRequest 阶段
// 替换为基于完整 body 的 xxhash64 5 位十六进制摘要。
@@ -92,14 +91,3 @@ func buildBillingAttributionText(body []byte, cliVersion string) (string, error)
cliVersion, fp,
), nil
}
func buildBillingAttributionBlockJSON(body []byte, cliVersion string) ([]byte, error) {
text, err := buildBillingAttributionText(body, cliVersion)
if err != nil {
return nil, err
}
return json.Marshal(map[string]string{
"type": "text",
"text": text,
})
}