mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-09-21 14:19:18 +08:00
Recent Claude Code CLI versions no longer emit the cch=... signature field in their x-anthropic-billing-header system block (issue #3358). sub2api still injected cch=00000 when mimicking Claude Code for OAuth accounts and optionally signed it, so mimicked requests now diverge from real CLI traffic — the opposite of what the mimicry is for. - buildBillingAttributionText emits the block without the cch=00000 segment; cc_version + cc_entrypoint=cli are kept (detection and Anthropic's first-party signal rely on the block, not on cch). - Retire signing: remove the two enableCCH signBillingHeaderCCH call sites in buildUpstreamRequest / buildCountTokensRequest and delete the now-dead signBillingHeaderCCH, cchPlaceholderRe, cchSeed, xxHash64Seeded helpers. - enable_cch_signing is now a documented no-op (kept for backward compat). - Drop the obsolete signing tests (TestSignBillingHeaderCCH, TestXXHash64Seeded, TestSanitizeMustBeBeforeCCHSigning_HashConsistency) and update the prompt test to assert the injected block no longer carries cch=. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>