[codex] fix date range aggregation accuracy#130
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (22)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
| const { data, warnings } = await loadProviderData(providers, range); | ||
| const merged = mergeProviderData(data); | ||
| const stats = aggregate(merged, range.until); | ||
| const stats = aggregate(merged, range.until, range); |
There was a problem hiding this comment.
compare-periods still constructs currentRange/previousRange directly instead of going through the new validation path, so invalid dates or since > until can flow into aggregation here and return misleading stats rather than an MCP error. Please route these ranges through the shared validator or equivalent before loading/aggregating.
424d591 to
7a7a3e0
Compare
Summary
Root Cause
aggregate()inferredtotalDaysfrom the first and last active usage day. For sparse selected ranges, that made averages and compare deltas too high because inactive days inside the requested window were ignored.Validation
PATH="/Users/yansh/.bun/bin:$PATH" bun run testpassed: 12 successful Turbo tasks.PATH="/Users/yansh/.bun/bin:$PATH" bun run checkpassed: 10 successful Turbo tasks.PATH="/Users/yansh/.bun/bin:$PATH" bun run lintstill fails on existing unrelated lint debt: unused symbols and script console warnings outside this change scope.Notes
Turbo still emits the existing bun.lock parse/not-found warning in this worktree, but test and check tasks complete successfully.