[codex] Show weekly pace detail in Codex menu#1009
Conversation
a36909e to
4dfe006
Compare
…e-detail # Conflicts: # CHANGELOG.md
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 89b919d95a
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| ?? UsagePace.weekly(window: window, now: input.now, defaultWindowMinutes: 10080) | ||
| .flatMap { $0.expectedUsedPercent >= 3 ? $0 : nil }, |
There was a problem hiding this comment.
Skip fallback pace when weekly quota is already exhausted
The new input.weeklyPace ?? UsagePace.weekly(...) fallback computes and renders pace even when the weekly lane has no remaining quota, because it bypasses the window.remainingPercent > 0 guard enforced by UsageStore.weeklyPace. In any UsageMenuCardView.Model.make path that omits precomputed weeklyPace (the case this change targets), an exhausted Codex weekly window can now show misleading pace text like “Runs out now” instead of suppressing pace detail; this diverges from existing pace semantics used elsewhere (store/CLI).
Useful? React with 👍 / 👎.
Summary
Root cause
The Codex projection renderer had a valid weekly RateWindow to draw, but its pace detail depended entirely on
input.weeklyPacebeing precomputed by the caller. When that value was absent, the GUI row still showed the weekly percentage/reset while omitting the reserve/deficit detail, even though the CLI could compute the pace directly from the same window.Validation
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer swift test --filter CodexBarTests.MenuCardModelCodexProjectionTestsgit diff --check