Align reset countdown formatters at 24h and the last minute (SBS-927) - #324
Conversation
CLI hours > 24 printed 24h Xm where tray and the TypeScript hooks already said 1d 0h, and tooltip_short_reset floored a still-future 30s remainder to 0m. One shared floor-and-clamp / 1440-minute breakdown now feeds every reset surface (SBS-927).
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
ceiling | afdf896 | Commit Preview URL Branch Preview URL |
Aug 18 2026, 02:27 AM |
|
Warning Review limit reached
Next review available in: 17 minutes Limit details: You’ve used all 1 included review currently available under your plan. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
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 |
Automated reviewNew in this pass: 1 issue.
Resolved since the previous pass: 3. For coding agents: fix BLOCK and FIX IF QUICK findings now; everything else is tracked or informational; never exceed one CodeRev fix round per PR. Advisory. Findings generated by |
Every caller proves the reset is still in the future, then handed the gap to the shared helper as num_seconds(). That truncates the last 999ms to zero, and the helper reads a zero remainder as due, so the CLI statusline, the MCP reset countdown, the native tooltip, the taskbar strip, and the compact tray status all printed "0m" for the final second of a window. The TypeScript hooks work in milliseconds and printed "1m" for the same instant, so the two surfaces disagreed. The helper now takes a Duration, which keeps the unit in the type rather than in a convention every caller has to remember. Only a remainder that is genuinely due or past reads as zero.
format_eta cast a float count of seconds to i64, so half a second remaining truncated to zero and printed "0m" while the tray, tooltip, and CLI read the same instant as "1m".
…ntdown-agree # Conflicts: # CHANGELOG.md
Summary
User-visible result
Tray, CLI, and tooltip at 24h 1s show 1d 0h (or Resets in 1d). At 30s they show 1m, never 0m.
Quality gate
Fail-without-fix
Sweep
Aligned: RateWindow, tooltip_short_reset, bridge label, Codex, UsagePace, Z.ai, StepFun, TS hooks, TaskbarFlyout.
Left different: PaceSection/PaceVerdict formatEta (GitHub 79, pace not reset). Locale sentence drops 0h (Resets in 1d).
What this makes more likely
Codex reset_description now keeps a zero unit (1d 0h / 2h 0m). Compact tray status no longer zero-pads minutes.
Gaps
Desktop rust tests and full frontend suite not run here. Issue left In Progress. Not merged.
Linear: https://linear.app/southboundsoftware/issue/SBS-927/reset-countdown-formatters-disagree-at-the-24-hour-and-last-minute
Note
Align reset countdown formatting across CLI, tray, tooltip, and TypeScript hooks at 24h and last minute
remainingCountdownParts/remaining_countdown_partshelpers in TypeScript and Rust that floor total minutes, clamp sub-minute future remainders to1m, and cut days at 1440 minutes (24h →1d 0h).useFormattedResetTime/useResetCountdownhooks — to use these shared helpers instead of ad-hoc math.0mappearing in the last minute and incorrect day boundaries (e.g.25hpreviously not showing as1d 1h) across Codex, Stepfun, and Z.ai providers.2mfor 61–119s now show1m; sub-minute remainders show1minstead of0m; 24h+ε now renders as1d 0heverywhere.Macroscope summarized afdf896.