fix(usage): include OpenCode cached input in totals

Normalize OpenCode cache reads and writes consistently across usage views, persistence and telemetry.

Continues #20187.

Co-authored-by: griffinmartin <griffinmartin@users.noreply.github.com>
This commit is contained in:
Neil
2026-10-02 20:41:18 -07:00
committed by GitHub
co-authored by griffinmartin
parent 6e6f651380
commit f1463683ee
10 changed files with 162 additions and 31 deletions
@@ -9,7 +9,8 @@ import type {
// Why: v4 reads OpenCode 2's `session_v2` table; v3 caches miss every v2 session.
// v5 merges a migrated session's two rows per column instead of picking one, so
// v4 caches hold zeroed costs and pre-migration metadata.
export const OPENCODE_USAGE_SCHEMA_VERSION = 5
// v6 normalizes input; v7 preserves writes separately for telemetry.
export const OPENCODE_USAGE_SCHEMA_VERSION = 7
export const openCodeUsageProvider = {
id: 'opencode',