Repository navigation
fix(claude): scope requestless dedupe by timestamp so daily matches weekly/monthly - #1799
Conversation
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ccusage-guide | d93a58c | Commit Preview URL Branch Preview URL |
Sep 25 2026, 04:06 PM |
ccusage
@ccusage/ccusage-darwin-arm64
@ccusage/ccusage-darwin-x64
@ccusage/ccusage-linux-arm64
@ccusage/ccusage-linux-x64
@ccusage/ccusage-win32-x64
commit: |
…un-36116493263-attempt-1
Scoping requestless exact matches by timestamp let /btw sidechain replays without a request ID through, because the regular loader's replay fallback also required equal timestamps. Match requestless replays across timestamps, as the daily loader does. Share the timestamp-aware exact key between both loaders so gateway logs that reuse one message ID no longer land in a single bucket, and give parent candidates a replay route that only holds sidechain entries. New entries are appended to their buckets without a duplicate scan, so loading stays linear.
Run daily, weekly, monthly and session over a requestless /btw replay and over gateway responses that share one message ID, and require the same totals from every report.
ccusage performance comparisonPR SHA: Performance comparison skipped. Base package URL was not ready before 300.000s. Fixture performance comparison requires a base package when --base-dir is not provided. Base package: |
ccusage performance comparisonPR SHA: Performance comparison skipped. Base package URL was not ready before 300.000s. Fixture performance comparison requires a base package when --base-dir is not provided. Base package: |
ccusage performance comparisonPR SHA: This compares the Rust PR release binary against the configured base package on the same CI runner. Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
ccusage performance comparisonPR SHA: This compares the PR package against the configured base package on the same CI runner. Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
A requestless gateway rewrite at the same timestamp replaces the survivor without changing its exact key or replay route, yet both were registered again with a linear membership scan over buckets that now hold every retained timestamp. Only register keys that changed.
ccusage performance comparisonPR SHA: This compares the Rust PR release binary against the configured base package on the same CI runner. Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
ccusage performance comparisonPR SHA: This compares the PR package against the configured base package on the same CI runner. Package runtime diagnosticsCompares the PR package wrapper, the installed native optional dependency binary, and the workspace release binary on the same large fixture. This identifies whether slow package results come from JavaScript wrapper overhead, the published native binary build, or the Rust core itself. Fixtures: Claude
Committed fixture performanceCommitted small fixtures for stable PR-to-PR feedback and explicit Claude/Codex command coverage. Fixtures: Claude
Large real-world-shaped fixture performanceGenerated fixtures shaped from aggregate local log statistics: thousands of JSONL files, many small sessions, and a long tail of larger sessions. No real prompts, paths, or outputs are stored in the fixtures. Fixtures: Claude
Artifact size
Lower medians and smaller artifacts are better. CI runner noise still applies; use same-run ratios as directional PR feedback, not release guarantees. |
Fixes #1797:
ccusage claude dailyreported ~475M tokens whileweekly/monthlyreported ~270M over the same window.Root cause
The two Claude loaders disagreed on requestless (
requestId-absent) dedupe. The entry loader behindweekly/monthly/session/blockscollapsed the same message ID within a session across distinct timestamps. The daily loader keys requestless entries by message ID, session, and timestamp. Gateways that answer every response with one message ID and no request ID (#1635) therefore lost usage inweekly/monthly, whiledailycounted each response.Changes
usage_dedupe_hash): matching message and request IDs identify one response across sessions; without a request ID the key is scoped to session and timestamp. Repeated writes at the same timestamp still collapse to the most complete record./btwreplays stay deduplicated. A sidechain replay where neither entry has arequestIdmatches its parent across timestamps, as the daily loader already did. Replays carrying a new request ID keep the regular loader's existing timestamp rule.Validation
claude daily|weekly|monthly|sessionand require identical totals for a requestless sidechain replay and for gateway responses reusing one message ID. The replay test fails on the previous PR head and the gateway test fails onmain.cargo test --workspace(943 passed),cargo clippy --workspace --all-targets -- -D warnings, andjust hawkare clean.claude daily|weekly|monthly|session --since 20260901 --until 20260924 --jsonoutput is byte-identical tomain.weeklydailymonthlydaily