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
Commit e7a7ee4
Browse filesBrowse the repository at this point in the historyBrowse files
fix(all): keep sessions last active on the --until day (ccusage#2008)
* fix(all): keep sessions last active on the --until day
Session reports in the unified loader and the qwen adapter bounded the
window by comparing a session's `lastActivity` against `--since`/`--until`
as text after stripping dashes. `lastActivity` is a full RFC 3339
timestamp, so `20260704T18:00:00.000Z` sorted after the `20260704` bound
and every session whose last activity fell on the `--until` day dropped
out of the report, while `--since` ignored `--timezone` because the
comparison used the UTC date.
Replace both copies with one `ccusage-adapter-common` helper that parses
the timestamp, takes its calendar day in the report timezone the same way
`LoadedEntry::date` does, and reuses `date_within_range`, so session
reports treat the bounds as inclusive whole days like daily reports.
* test(adapter): cover the session window edge cases from review
Document `filter_session_summaries_by_last_activity` in the crate README,
add `--since`-only and missing/unparseable `lastActivity` cases for the
helper, and restore a fixture-backed Qwen session test that checks the
`--until` day boundary in the report timezone through the JSON report.
* test(qwen): cover the session --until boundary through the CLI
The hand-rolled Qwen unit test replayed load, summarize, and filter
itself, so it would keep passing if `qwen session` stopped applying the
window. Replace it with an integration test that runs the real binary
with `--since`/`--until` in America/Los_Angeles, asserts the JSON report,
and snapshots the session table.
* fix(rust): show Last Activity in the report timezone and keep TZDIR in the Qwen CLI test
The Qwen CLI test clears the child environment, which drops the TZDIR
that the sandboxed Nix test derivation sets so jiff can resolve named
zones. The binary then rejected `--timezone America/Los_Angeles` on CI
while passing locally, where the system zoneinfo is found without it.
Forward TZDIR when it is set.
The session table's Last Activity column truncated the RFC 3339
`lastActivity` to its UTC date, so a session selected for the 23rd in
America/Los_Angeles rendered as the 24th. Format the date in the report
timezone like every other date column; JSON output keeps the full
timestamp, and existing table snapshots all report in UTC, so only the
Qwen snapshot changes.
* test(claude): check the session window drops the day after --until
With a single session the unified session CLI test only caught sessions
wrongly dropped on the `--until` day; it would still pass without any
window filter. Add a second session last active just after local
midnight so the asserted total also fails when the filter keeps too much.
Also note in the session guide that the Last Activity table column shows
the date in the report timezone while JSON keeps the RFC 3339 timestamp.
* docs(session): link the Last Activity note to the JSON field reference
The note now defines how the table column relates to the JSON
`lastActivity` field, so point it at that field's description in the
JSON output guide.
Copy file name to clipboardExpand all lines: docs/guide/session-reports.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ Sessions are displayed using the last two segments of their full identifier:
91
91
-**Input/Output Tokens**: Total tokens exchanged in the conversation
92
92
-**Cache Tokens**: Cache creation and read tokens for context efficiency
93
93
-**Cost**: Estimated USD cost for the usage shown; without a date filter, the entire conversation
94
-
-**Last Activity**: Date of the most recent message included in the report
94
+
-**Last Activity**: Date of the most recent message included in the report, shown in the report timezone (`--timezone`); JSON output keeps the full RFC 3339 [`lastActivity`](/guide/json-output#session-reports-1) timestamp
0 commit comments