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
Resumed sessions are counted repeatedly in cumulative usage totals #413
Every SessionEnd reparses the full transcript and appends a cumulative record. The reader currently sums all records, so ending and resuming the same session counts its earlier usage again and inflates both usage and session totals.
Observed on upstream ce30de7ca94115cb73fa991538c6d2595ac2622a.
Focused correction
Keep the last valid appended record for each nonempty session ID when reading. Leave storage append-only, preserve anonymous legacy rows individually, and retain missing-counter defaults. Tests include a real transcript parse/append/resume/read lifecycle.
Validation
The repository-native focused tests report 5 failures and 23 passing controls on unchanged production source; the prepared correction passes all 28 focused tests. The final commit is independently validated by the full Node 22/Linux suite with coverage, typecheck, build, duplication guard and critical-only bundle audit. The workflow enforces zero failed and zero skipped tests.
I am taking the implementation because the regression is reproducible and the change can remain focused. I will link the corresponding pull request.
Scope
The latest appended record is treated as the cumulative snapshot for that session, matching the current SessionEnd producer. This does not reconcile out-of-order writers or a transcript reset under a reused session ID; the log format and savings formula are unchanged.
Activity