Skip to content

[Bug] Cache Creation Tokens Have Been Zero Since July 29, Possibly Due to Backend Data Retrieval or Parsing #1409

Description

@cg8-5712

[Bug] Cache Creation Tokens Have Been Zero Since July 29, Possibly Due to Backend Data Retrieval or Parsing

Description

Since 2026-07-29, the Cache Creation / cache write token metric on the statistics page has consistently been reported as 0, while a substantial number of Cache Read / cache read tokens are still being recorded.

The issue may originate from one of the following areas:

  • The backend is not correctly retrieving cache creation metrics from the upstream response;
  • A backend field mapping or aggregation issue;
  • The parsing logic is incompatible with a change in the upstream response schema;
  • The frontend is reading or displaying the response field incorrectly.

Observed Behavior

  • Statistics date range: 2026-07-29 to 2026-08-10
  • Page display:
    • Cache Tokens: 772.76M
    • Write / Cache Creation: 0
    • Read / Cache Read: 772.76M

Relevant fields from the stats-summary API response:

{
  "totalCacheCreation1hTokens": 0,
  "totalCacheCreation5mTokens": 0,
  "totalCacheCreationTokens": 0,
  "totalCacheReadTokens": 772761877
}

Other usage metrics appear to be populated normally:

{
  "totalRequests": 7122,
  "totalInputTokens": 74786955,
  "totalOutputTokens": 2564271,
  "totalTokens": 850113103
}

Expected Behavior

The system should correctly collect and display Cache Creation Tokens whenever cache creation activity occurs.

Although some individual periods may legitimately have no new cache writes, all Cache Creation Token metrics should not remain 0 from July 29 onward unless the upstream source data explicitly reports zero values.

Actual Behavior

Since 2026-07-29, all Cache Creation-related fields have remained zero across the queried period:

totalCacheCreation1hTokens = 0
totalCacheCreation5mTokens = 0
totalCacheCreationTokens = 0

At the same time, totalCacheReadTokens continues to report significant usage, and the UI consistently displays Write: 0.

Impact

  • Cache Creation Token usage is underreported or missing entirely;
  • Cache usage analysis cannot accurately reflect cache creation cost and behavior;
  • Usage reports, cost analysis, model request analysis, and alerts may be affected;
  • If these metrics are used for billing or operational reporting, downstream decisions may be based on inaccurate data.

Suggested Investigation

  1. Compare raw upstream API responses before and after 2026-07-29 to determine whether cache creation-related fields changed in name, structure, or unit.
  2. Review backend retrieval, deserialization, field mapping, and aggregation logic, especially for:
    • cache_creation_input_tokens
    • cache_creation_1h_tokens
    • cache_creation_5m_tokens
    • Internal mappings to totalCacheCreation*Tokens
  3. Review releases, dependency updates, and API schema changes around July 29.
  4. Verify whether Cache Creation fields are being omitted, overwritten, or filtered incorrectly during time-range aggregation.
  5. If the raw backend response already contains non-zero values, verify the frontend API adapter and display logic.

Acceptance Criteria

  • Identify the root cause of Cache Creation Tokens becoming zero starting on 2026-07-29;
  • Ensure the stats-summary API returns accurate totalCacheCreation*Tokens values;
  • Ensure the statistics page displays Cache Creation Token values correctly;
  • Backfill affected historical data after July 29, or document why backfill is not possible and define the affected scope;
  • Add coverage for the relevant parsing and aggregation paths so upstream schema changes cannot silently result in zero values again.

Attachment

The attached screenshot shows that the UI reports Write: 0 for Cache Tokens, while the API response reports all totalCacheCreation*Tokens as 0 and totalCacheReadTokens as 772,761,877.

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions