Skip to content

[codex] Show weekly pace detail in Codex menu#1009

Merged
steipete merged 3 commits into
steipete:mainfrom
zhulijin1991:codex/show-weekly-pace-detail
May 18, 2026
Merged

[codex] Show weekly pace detail in Codex menu#1009
steipete merged 3 commits into
steipete:mainfrom
zhulijin1991:codex/show-weekly-pace-detail

Conversation

@zhulijin1991
Copy link
Copy Markdown
Contributor

Summary

  • derive a linear weekly pace fallback from the Codex weekly lane when no precomputed weekly pace is attached to the menu model
  • keep existing historical/precomputed pace behavior when available
  • add a regression test that expects the Weekly row to show the reserve detail from its visible window

Root cause

The Codex projection renderer had a valid weekly RateWindow to draw, but its pace detail depended entirely on input.weeklyPace being 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.MenuCardModelCodexProjectionTests
  • git diff --check

@zhulijin1991 zhulijin1991 force-pushed the codex/show-weekly-pace-detail branch from a36909e to 4dfe006 Compare May 17, 2026 16:14
@zhulijin1991 zhulijin1991 marked this pull request as ready for review May 17, 2026 16:42
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +1425 to +1426
?? UsagePace.weekly(window: window, now: input.now, defaultWindowMinutes: 10080)
.flatMap { $0.expectedUsedPercent >= 3 ? $0 : nil },
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@steipete steipete merged commit 599c017 into steipete:main May 18, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants