Skip to content

Roll Claude reset date forward across the year boundary#1947

Merged
steipete merged 2 commits into
steipete:mainfrom
devYRPauli:fix/claude-reset-year-boundary
Jul 6, 2026
Merged

Roll Claude reset date forward across the year boundary#1947
steipete merged 2 commits into
steipete:mainfrom
devYRPauli:fix/claude-reset-year-boundary

Conversation

@devYRPauli

@devYRPauli devYRPauli commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Roll yearless Claude date-and-time quota resets into the next year when their current-year interpretation is already in the past.
  • Apply the behavior to both minute-bearing and hour-only reset formats, matching the existing Codex parser contract.
  • Add focused year-boundary coverage and changelog credit for @devYRPauli.

User-visible effect

On December 31, a Claude reset such as Jan 2, 3:15am now remains an upcoming reset. Previously it parsed as January of the current year, causing countdown surfaces to show now and active-window checks to treat the quota as expired.

Verification

  • Focused status-probe selection: 253 passed.
  • Source-blind public API contract: 5/5 passed for both changed formats, same-year preservation, downstream countdown text, and invalid input.
  • make check: passed.
  • Full local make test: all 48 shards passed.
  • Autoreview: clean, 0.99 confidence.
  • Public Model Identifier Gate: PASS; no model identifiers changed.
  • Dependency freshness: no dependency changes.

@clawsweeper

clawsweeper Bot commented Jul 6, 2026

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed July 6, 2026, 11:16 AM ET / 15:16 UTC.

Summary
The PR wraps Claude date+time reset parsing in a year-roll-forward guard and adds a Dec 31 to Jan 2 regression test.

Reproducibility: yes. from source inspection: current main parses yearless Claude date+time reset strings with the current year and returns them directly, so a Dec 31 now with a Jan 2 reset resolves into the past.

Review metrics: 2 noteworthy metrics.

  • Diff surface: 2 files changed, +28/-2. The branch is limited to the Claude reset parser and one focused status-probe regression test.
  • Check rollup inspected: 5 successful, 4 macOS Swift shards queued/in progress. Required macOS test completion should gate merge because this read-only review did not run local tests.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🦞 diamond lobster
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P2] Let the queued or in-progress macOS Swift test shards complete before merge.

Risk before merge

  • [P1] The inspected check rollup still had macOS Swift test shards queued or in progress, so merge should wait for required CI completion or explicit maintainer override.

Maintainer options:

  1. Decide the mitigation before merge
    Merge the narrow parser fix after required CI completes, keeping Claude reset parsing aligned with the existing Codex year-roll-forward behavior.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • No automated repair is needed because the proof gap from the prior review appears addressed and the remaining action is normal CI and maintainer merge review.

Security
Cleared: The diff only changes Claude reset parsing and a focused test, with no secrets, dependencies, workflows, build scripts, or supply-chain surface changed.

Review details

Best possible solution:

Merge the narrow parser fix after required CI completes, keeping Claude reset parsing aligned with the existing Codex year-roll-forward behavior.

Do we have a high-confidence way to reproduce the issue?

Yes, from source inspection: current main parses yearless Claude date+time reset strings with the current year and returns them directly, so a Dec 31 now with a Jan 2 reset resolves into the past.

Is this the best way to solve the issue?

Yes, the PR is the narrowest maintainable fix I found: it reuses the existing roll-forward pattern already present in the time-only Claude branches and sibling Codex parser.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against b00797537dbf.

Label changes

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The PR body now includes after-fix copied live output from a throwaway executable invoking compiled CodexBarCore parser and formatter, with a clear before/after result.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body now includes after-fix copied live output from a throwaway executable invoking compiled CodexBarCore parser and formatter, with a clear before/after result.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This fixes a bounded Claude quota reset display bug that can show an active quota window as already expired near the year boundary.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The PR body now includes after-fix copied live output from a throwaway executable invoking compiled CodexBarCore parser and formatter, with a clear before/after result.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body now includes after-fix copied live output from a throwaway executable invoking compiled CodexBarCore parser and formatter, with a clear before/after result.
Evidence reviewed

What I checked:

Likely related people:

  • ratulsarna: Commits 02bd8e8 and a86e240 improved Claude CLI/PTY status parsing and added surrounding reset parsing tests. (role: introduced relevant reset parsing behavior; confidence: high; commits: 02bd8e8d0f76, a86e240ee9e7; files: Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift, Tests/CodexBarTests/StatusProbeTests.swift)
  • steipete: Recent commits cfd747f and 81091f9 touched Claude provider behavior and tests near this parser surface. (role: recent area contributor; confidence: high; commits: cfd747f8d232, 81091f977185; files: Sources/CodexBarCore/Providers/Claude/ClaudeStatusProbe.swift, Tests/CodexBarTests/StatusProbeTests.swift)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
Review history (1 earlier review cycle)
  • reviewed 2026-07-06T14:35:34.221Z sha 660ebee :: needs real behavior proof before merge. :: none

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jul 6, 2026
devYRPauli and others added 2 commits July 6, 2026 10:15
ClaudeStatusProbe.parseResetDate handled its two date+time branches
("MMM d, h:mma" etc.) by returning the parsed date as-is. Those formats
carry no year, so DateFormatter.defaultDate = now fills in the current
year. When the reset month/day is earlier in the calendar than now (a
"Jan 2" reset read on Dec 31), the result lands ~a year in the past.

A past resetsAt makes resetCountdownDescription clamp to "now"/"0h" and
widget "is active" checks treat the window as already expired, so the UI
shows the quota as reset hours before it actually is.

The time-only branches already roll forward (by a day), and the sibling
CodexStatusProbe already guards this exact case with bumpYearIfNeeded.
Apply the same guard to Claude's date+time branches.

Add a regression test that crosses the year boundary (now = Dec 31,
reset = "Jan 2, 3:00am"): it must resolve to next year and be in the
future.
@steipete steipete force-pushed the fix/claude-reset-year-boundary branch from 660ebee to 85183ac Compare July 6, 2026 17:25

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

Copy link
Copy Markdown

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: 85183acd38

ℹ️ 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 +665 to +666
if date >= now { return date }
return calendar.date(byAdding: .year, value: 1, to: date)

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 Avoid rolling stale reset times a full year

When the status probe crosses a reset boundary, this now treats any parsed date that is even seconds in the past as the same month/day next year. fetch() captures /usage first and only later parses the reset strings after the optional /status probe, so a weekly line like Resets Jul 6, 3:00pm captured just before 3:00 but parsed just after 3:00 becomes July 6 of the following year instead of a stale/expired reset. That leaves menus/countdowns with a reset hundreds of days out; please restrict the year bump to plausible Dec→Jan wraparound cases, such as when the bumped date is within the Claude reset window.

Useful? React with 👍 / 👎.

@steipete

steipete commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Maintainer verification on exact head 85183acd3821cdf43268814b9f2b0b19f335842f:

  • Rebased onto current main; contributor commit/authorship preserved and changelog credits @devYRPauli.
  • Expanded the regression to cover both changed parser branches: minute-bearing and hour-only yearless reset dates.
  • Focused status-probe selection: 253 passed.
  • Source-blind public API contract: 5/5 passed, covering both changed formats, same-year preservation, downstream countdown text, and invalid input.
  • make check: passed.
  • Full local make test: all 48 shards passed.
  • Clean autoreview: 0.99 confidence, no actionable findings.
  • Exact-head hosted checks: Linux x64 (7m15s), Linux arm64 (6m10s), lint, change detection, and GitGuardian all passed.
  • Four hosted macOS shards remain capacity-queued. Landing under the documented capacity-only policy because the exact candidate has full local 48-shard proof and both Linux jobs are green.
  • Public Model Identifier Gate: PASS. No model identifiers changed.
  • Dependency freshness: no dependency changes.

The black-box validation confirms the reset remains future-facing and yields in 1d 4h instead of the stale now presentation.

@steipete steipete merged commit 70ef850 into steipete:main Jul 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants