发布

  • [OPIK-7392] [BE] fix: split cipx cache-creation tokens by TTL (5m vs 1h) (#7565)

    frostbyte_neo 发布于 2026-07-22 13:13:41 +00:00

    • [OPIK-7392] [BE] fix: split cipx cache-creation tokens by TTL (5m vs 1h)

    Cache writes are billed by TTL (5-minute = 1.25x input, 1-hour = 2x input) and
    Claude Code writes its cache with a 1-hour TTL, but cipx_spends collapsed the
    split into a single u_cache_creation lump, so AI-spend priced everything at the
    5m rate (~18% cost understatement).

    • migration 000109: add u_cache_creation_5m / u_cache_creation_1h to cipx_spends
    • CipxSpendDAO: parse and persist the split from usage.cache_creation
    • CipxSpendBlockDAO: a span is a single LLM call with one TTL, so each write
      block inherits the span's TTL into its tier (cache_creation_5m / _1h)

    Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

    • docs(cipx): fix tierName javadoc link and migration trailing newline

    Address PR #7565 review: correct the @link in CipxSpendBlockDAO to the
    nested BlockRow#tierName(int, String) signature, and end migration 000109
    with a trailing blank line per migrations.md.

    Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

    • docs(cipx): trim cost rationale from migration 000109 comment

    Address PR #7565 review: keep the OSS migration comment to the technical
    schema change (what the columns are and their source), dropping the
    pricing/cost explanation, which lives in the cost-api repo.

    Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

    下载附件