Improve weekly pace projection using learned time-of-day profiles#401
Improve weekly pace projection using learned time-of-day profiles#401EthanLipnik wants to merge 1 commit intosteipete:mainfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 37ac40c964
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| let minutes = window.windowMinutes ?? Self.weeklyWindowMinutes | ||
| let delta = abs(minutes - Self.weeklyWindowMinutes) |
There was a problem hiding this comment.
Require explicit weekly duration before showing pace
isWeeklyWindow currently treats window.windowMinutes == nil as a 7-day window, which makes non-weekly quotas eligible for weekly pace output. For example, Cursor emits windowMinutes: nil with a monthly billingCycleEnd (Sources/CodexBarCore/Providers/Cursor/CursorStatusProbe.swift:259-263), so this path will start showing a “weekly” pace during the last 7 days of a monthly cycle, producing misleading deficit/runway values.
Useful? React with 👍 / 👎.
| let minutes = window.windowMinutes ?? Self.weeklyWindowMinutes | ||
| let delta = abs(minutes - Self.weeklyWindowMinutes) | ||
| return delta <= Self.weeklyWindowToleranceMinutes |
There was a problem hiding this comment.
Exclude unknown-duration windows from profile learning
The profile store uses the same weekly check that defaults nil minutes to 7 days, so it will learn “weekly” time-of-day rates from windows whose period is actually unknown or non-weekly. With providers like Cursor (monthly reset, no windowMinutes), this contaminates pace-profiles-v1.json with non-weekly behavior and then feeds those profiles back into pace projections when a reset enters the final week.
Useful? React with 👍 / 👎.
Why
The old pace logic was purely linear, so it assumed people use Codex uniformly 24/7. In
practice that over-reported deficit/runout (especially overnight) and frequently showed
misleading “~2 days left” style projections.
What Changed
thresholds.
User Impact
Validation