fix(claude): distinguish extra usage credits from rate-limit windows - #516
Merged
Conversation
Overage warnings were labeled as a generic rate limit, so exhausted extra credits looked like a 5-hour or weekly window that had failed to reset. Co-authored-by: Cursor <cursoragent@cursor.com>
astyfx
requested review from
JongSikLim and
dodonmountain
and removed request for
a team
September 8, 2026 04:36
astyfx
enabled auto-merge (squash)
September 8, 2026 04:36
|
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
27b6af5 < |
2026-09-08 04:37 UTC | 0 | 0 | 0 |
Last scanned: 27b6af5 · 2026-09-08 04:37 UTC
|
| Commit | Scanned at | New | Resolved | Net |
|---|---|---|---|---|
27b6af5 < |
2026-09-08 04:37 UTC | 0 | 0 | 0 |
Last scanned: 27b6af5 · 2026-09-08 04:37 UTC
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Claude
rate_limit_eventwarnings now name the limiting window, including extra usage credits, so an exhausted credit balance is no longer shown as a 5-hour or weekly rate limit that failed to reset.Changes
Fixes
rateLimitType: "overage"as extra usage credits instead of a generic rate limitoverageResetsAtand include the calendar date when the reset is not todayRefactors / Chores
buildClaudeRateLimitEvents()and drop unusedapi_error_statussuffix (not present on SDK rate-limit info)Test Evidence
bun run typecheckpassedbun test tests/claude-sdk-runtime.test.ts— 161 pass (7 new cases for overage labeling, window names, credit suffixes, reset formatting, and the unknown-window regression)Notes
Status-bar usage meters still map only session/weekly windows; extra-usage remaining credits are not shown there. Rate-limit warnings remain per-turn system events with no session-level dedupe.