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
Unified session report drops pi sessions on the inclusive --until day #1390
ccusage session and ccusage pi session disagree about which pi sessions fall inside the same date window.
The unified report filters pi sessions by comparing the session's lastActivity against the --until date as strings. lastActivity is a full RFC3339 timestamp, so after dash removal a session at 2026-07-04T18:00:00Z becomes 20260704T180000Z, which sorts after20260704 — and the session gets dropped even though it's on the until day. The pi session --pi-path path filters entries by date before summarizing, so it keeps the session.
Concretely, against the same store:
ccusage session --json -u 20260704 # pi session from 2026-07-04 missing
ccusage pi session --json -u 20260704 # same session present
Steps to reproduce
Have a pi session whose last activity is on day X (e.g. 2026-07-04T18:00:00Z).
Run ccusage session --json -u 20260704 — the session is missing from the unified output.
Run ccusage pi session --json -u 20260704 — the session is there.
Expected behavior
--until is inclusive everywhere. The unified report should return the same pi sessions as the pi subcommand for the same window.
Version
v20.0.14 (also reproduced on current main)
I have a fix ready (filter entries by date before summarizing, same as the pi subcommand does) with a regression test that fails on main and passes with the fix. Happy to open a PR.
Activity
pullfrog commentedon Jul 4, 2026