Skip to content

fix(gateway): stabilize Anthropic billing cch for cache#478

Merged
mylukin merged 2 commits into
mainfrom
codex/fable-cache-cch
Jul 6, 2026
Merged

fix(gateway): stabilize Anthropic billing cch for cache#478
mylukin merged 2 commits into
mainfrom
codex/fable-cache-cch

Conversation

@mylukin

@mylukin mylukin commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stabilize the rotating Claude Code billing cch on Anthropic native passthrough requests
  • keep passthrough body semantics intact: preserve cc_version, cc_entrypoint, system/messages/tools/cache_control
  • record anthropic_billing_cch_stabilized in passthrough mutations for auditability

Why

Production claude-fable-5 telemetry showed the official Claude Code billing header changes only cch every turn, which sits at system[0] and breaks Anthropic prompt-cache prefix matching. This is a cost-compatibility shim, not a broad passthrough rewrite.

Validation

  • pnpm exec vitest run apps/gateway/src/routes/execute.test.ts
  • pnpm typecheck
  • pnpm exec biome check apps/gateway/src/routes/execute.ts apps/gateway/src/routes/execute.test.ts
  • git diff --check

Note: full pnpm lint is currently blocked by an unrelated existing lint finding in packages/core/src/memory/forgetting/facts.test.ts:64.

mylukin and others added 2 commits July 6, 2026 20:32
@mylukin mylukin merged commit 3524acd into main Jul 6, 2026
3 checks passed
@mylukin mylukin deleted the codex/fable-cache-cch branch July 6, 2026 12:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant