Skip to content

feat(panel): reset odds from whenreset.app - #61

Merged
InfinityScripter merged 7 commits into
mainfrom
claude/whenreset-odds
Oct 14, 2026
Merged

InfinityScripter merged 7 commits into
mainfrom
claude/whenreset-odds

Conversation

@InfinityScripter

@InfinityScripter InfinityScripter commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

What this changes

Adds a "Reset odds" card under the limits strip: the chance that Claude or Codex limits get reset early, taken from whenreset.app's public API (/api/v1/resets.json, no key).

  • Folded: one line, "Reset in 24h", with the 24-hour figure for each provider (✦ 8% · </> 13%).
  • Unfolded (chevron): for each provider, the 24h / 48h / 7d odds, when it was last reset, and how many resets the site has tracked ("53 resets tracked · 5 in last 30 days"), plus a line when a banked reset is newer than the last regular one. The footer links to whenreset.app and says how old the figures are.
  • The limits tooltip also carries the 24-hour figure.
  • Settings → General → Limits → "Limit reset odds", on by default. Turning it off removes the card, stops the request and clears the cache.

How it fetches: an ephemeral session with redirects refused, a 15 s timeout and its own User-Agent, at most once every 15 minutes (on a 5-minute timer, at launch and when the panel opens). The last good answer is kept in UserDefaults, so the card shows right after launch. Answers over 1 MB are ignored. If the network fails, the card shows the cached figures marked as old, or "loading" / "unavailable". It never shows 0% for an unknown value.

Parsing and the card's rules (state, staleness, note, banked line, counts) live in Sources/Model/ResetOdds.swift and are covered by the model checks. The request is listed in PRIVACY.md.

Issue

—

How you tested it

  • Tested in the Claude desktop app
  • Tested in the CLI, in a terminal
  • Which terminal did you use? n/a: the card does not depend on the terminal.
  • What you did and what you saw:
    1. Model checks: 1107 ok (1039 before), including the real API answer, broken JSON, null odds, NaN, 1e30, a 1.1 MB answer and the staleness boundary.
    2. Python suite: 275 OK. Node suite: 108 pass, 0 fail (1 existing todo). Typecheck for macOS 13 is clean. Not checked locally with Swift 6.0, only 6.4, so the swift-6-0 job will cover it.
    3. Built from a clean clone and ran a copy with a changed bundle id next to the installed app. CONTROL_BAR_DUMP_MENU=1 prints the "Reset odds" block with both providers. In the live panel, clicking the chevron expands the card and the panel grows. Screenshots of the folded and unfolded card still need to be attached (the CLI cannot upload images).

Checklist

  • I built off the latest main, so I'm not fixing something that already changed.
  • One focused change, not a bundle of unrelated edits.
  • Screenshot or short screen recording attached for any visual or timing change.
  • I read CONTRIBUTING.md and the known issues, and this fits the scope.

Is this for everyone, or is it your fork?

For everyone: the card covers both providers the app already shows, and it can be switched off.

@InfinityScripter
InfinityScripter marked this pull request as ready for review October 14, 2026 19:01
@InfinityScripter
InfinityScripter merged commit 10bc039 into main Oct 14, 2026
2 of 3 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.

1 participant