You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cumulative token widgets over-report ~1.84x (upstream sirmalloc#549) — fix in our tree #8
Work item mirroring upstream sirmalloc/ccstatusline#549 — "Token widgets over-report ~1.84x: one JSONL entry per content block is counted per API call".
Problem: upstream writes one JSONL entry per content block sharing one message.id; the cumulative token widgets (Tokens Input / Output / Total) sum every entry, over-reporting by up to ~1.84x.
Already fixed in our tree (partial): the Tokens Last Turn widget (PR #1) groups entries by message.id and keeps the max output_tokens per API call; entries without an id start a new group; streaming partials resolve to the finalized value; sidechain/API-error rows are excluded. Verified on a synthetic sirmalloc#549-shaped transcript: exact Turn: 16.5k vs inflated cumulative Total: 49.3k on the same 3-entry id group.
Remaining work: apply the same grouping to the cumulative token path in getTranscriptAnalysis so Tokens Input/Output/Total stop over-reporting.
Acceptance: synthetic sirmalloc#549-shaped transcript yields exact cumulative totals; bun test green; no behavior change for transcripts without duplicate-id entries.
Activity
fix(jsonl): dedup cumulative token counts by message.id (#8) (#9)