Skip to content

Investigate missing prompt-cache accounting for GLM / Ollama subscription runs #31

Description

@raychrisgdp

Summary

The recent GLM / Ollama subscription reports do not seem to carry prompt-cache information the way the dashboard expects. The user specifically observed that GLM from the Ollama subscription looked like it had no prompt cache or cache accounting at all.

Current evidence

On the current dashboard data, the closest live row is glm-5.2 (go):

  • tool: OpenCode
  • pricing status: unpriced
  • pricing model ID:
  • tokens total: 705,207
  • cache read: 4,547,678
  • cache write: 0

That proves the dashboard can display cache tokens when they reach the source DB, but it does not answer whether the recent Ollama / GLM path is failing earlier in the pipeline.

What needs to be checked

  • whether OpenCode/Ollama emits prompt-cache or cache-read/write fields for these sessions
  • whether the local ingestion layer preserves those fields in the SQLite source data
  • whether the dashboard normalizer or API response is dropping cache fields for opencode-go / GLM rows
  • whether the UI should explicitly label missing cache as unknown instead of implying zero

Scope

  • Trace one recent GLM / Ollama subscription session end-to-end from source event to dashboard row
  • Compare the raw source payload with the row shown by /api/models and the daily/history views
  • Determine whether this is a provider-side gap, an OpenCode capture gap, or a dashboard parsing gap
  • Add a regression check once the failure point is known

Acceptance criteria

  • We can say exactly where the prompt-cache information disappears, or confirm that the provider never emits it
  • The dashboard no longer silently treats missing cache as zero without a reason
  • If the data exists upstream, it survives into the API response and the UI

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions