Skip to content

feat: show usage-limit resets; fix Claude API rows on the 1st - #13

Merged
okisooo merged 2 commits into
mainfrom
feat/usage-resets
Nov 1, 2026
Merged

okisooo merged 2 commits into
mainfrom
feat/usage-resets

Conversation

@okisooo

@okisooo okisooo commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

What

Codex and Claude get a Resets row while a free usage-limit reset is waiting, e.g. Resets · 1 available · until Dec 1. It shows under the provider's meters in the closed section and in the expanded limits table.

Sources

  • Codex: rate_limit_reset_credits.available_count comes back in every /wham/usage reply, the same field Codex's own "You have N usage limit resets available" message reads. The soonest expires_at comes from GET /wham/rate-limit-reset-credits, fetched only while resets exist and cached for 15 minutes (polls run every 10–30 s). Fleet never calls /consume.
  • Claude: /api/oauth/usage returns cedar_ember (granted resets: grants[].resets_left, ends_at, paused) and juniper_tide (the once-a-week 5-hour reset) only when asked with ?cedar_ember=1, which is the request Claude Code's usage menu makes. With the plain URL both come back null. Fleet does not send at_wall=1, which Claude Code sends only once a limit is actually reached.

Verification

  • 322 unit tests; the one failure (test_a_key_written_to_the_windows_registry_turns_its_provider_on) also fails on unmodified main on this machine.
  • New tests cover counting, expiry caching, failed detail requests, paused and expired Claude grants, and the 5-hour reset states.
  • Ran it live as local build 0.4.2.1: Codex shows Resets · 1 available · until Dec 1. The offscreen render at 100% scale fits.
  • I could not see a live Claude reset: this account currently reports cedar_ember.eligible: false (ineligible_reason: "surface") with no grants.

Also: Claude API rows showed "Http 400" on the first UTC day of each month

Anthropic's cost_report holds only finished UTC days. A range starting at 00:00 on the 1st (today) returns 400 Invalid date range: ending date must be after starting date. Both admin rows failed until midnight UTC. On the 1st, Fleet now asks from yesterday and skips that bucket when summing the month. Verified live: both rows read again. New test: test_first_of_the_month_asks_from_yesterday_and_keeps_it_out.

🤖 Generated with Claude Code

okisooo and others added 2 commits November 2, 2026 03:53
Codex reports rate_limit_reset_credits.available_count in every
/wham/usage reply; the soonest expiry comes from
/wham/rate-limit-reset-credits, read at most every 15 minutes and only
while resets exist. Claude's usage endpoint adds the cedar_ember
(granted resets) and juniper_tide (weekly 5-hour reset) blocks when
asked with ?cedar_ember=1, as Claude Code's usage menu does; the plain
URL returns them as null.

Both become one "Resets" row ("1 available · until Dec 1") that also
appears among the closed section's meters and never becomes the
balance headline.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cost report holds only finished UTC days. Asking from 00:00 on the
1st (today) returns http 400 "Invalid date range: ending date must be
after starting date", which turned both Claude API rows into "Http 400"
until midnight UTC. On the 1st, ask from yesterday and skip that bucket
when summing the month.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@okisooo okisooo changed the title feat: show waiting usage-limit resets for Codex and Claude feat: show usage-limit resets; fix Claude API rows on the 1st Nov 1, 2026
@okisooo
okisooo merged commit 0f457a1 into main Nov 1, 2026
7 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