Repository navigation
Don't treat a refused fast mode as the session's usage limit - #958
Conversation
With extra-usage credits used up, Claude Code's rate_limit_event comes back rejected with rateLimitType "overage": the credit pool fast mode bills to, resetting at the monthly cycle. Claude Code drops to standard speed and the plan keeps serving the session, but the app took any rejection as a plan limit and offered to continue after a reset weeks away. Ignore a rejection whose window is the overage pool, the same way an event is already ignored while extra usage is paying for the turn.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
|
@zcy22606 nice fix! merging |
Brings in upstream 633730d..8e4da94: resumed sessions no longer end a turn early on a replayed background-task notice, skills survive a UTF-8 cut at the 16 KiB prefix, quoted Git diff paths, a blank session keeps its project's account, question / approval sounds, clickable terminal links, remembered Preview / Source choice, project group reordering, compact rail tooltips, Vue / Svelte / Sass / Less / .env highlighting, Mono activity as an overview tab and the inline Mono intro card. Includes our upstreamed fixes hardbeat920#880, hardbeat920#883, hardbeat920#884, hardbeat920#958, hardbeat920#975 and hardbeat920#985. Adds upstream's @xterm/addon-web-links, @codemirror/lang-less, @codemirror/lang-sass, @codemirror/lang-vue and @replit/codemirror-lang-svelte dependencies. Conflicts: - App.tsx (hardbeat920#880), claudeProtocol.ts (hardbeat920#958), ProjectRail / MonoRailSection group-has-[button:focus-visible] (hardbeat920#985): take upstream's version of our fixes; drop our duplicate SOL-77 test and the stale focus-within notes. - Sidebar: upstream's rail tooltips with our i18n. - MonoIntro, MonoOverview: take upstream and re-translate; accept the MonoActivityPanel deletion. - GitChangesPanel, MarkdownModeToggle: keep i18n, take upstream's styles. Translated the new upstream UI (monos, shell, sessions, settings).
What changed
usageLimitFromRateLimitEventreturnsnullfor a rejectedrate_limit_eventwhoserateLimitTypeisoverage, so a session no longer shows the usage-limit notice ("continue after reset") when only fast mode's extra-usage credits are exhausted.Why
With extra-usage credits used up, Claude Code reports a rejection for the credit pool that fast mode bills to:
{ "status": "rejected", "rateLimitType": "overage", "overageStatus": "rejected", "overageDisabledReason": "out_of_credits", "isUsingOverage": false, "resetsAt": 1793491200 }resetsAtis the monthly credit reset, weeks out. Claude Code itself drops to standard speed and the plan keeps serving the session, butusageLimitFromRateLimitEventtreated any rejection that wasn't paid by extra usage as a plan limit, so the app paused the queue and offered to continue after that far-off reset.Plan windows (
five_hour,seven_day, …) and events without arateLimitTypebehave as before. Only theoveragewindow is excluded, rather than allowlisting known plan windows, so a plan window added later still stops the session.UI
No layout changes. The usage-limit notice no longer appears when only fast mode's credits run out.
Validation
claudeProtocol.test.tswith the event above; it fails onmain. The existingfive_hourand extra-usage tests still pass.npm run check:web: vitest (5285 passed, 13 skipped) andtsc --noEmit. No Rust changes.Checklist
npm run check(check:web; no Rust files changed)Summary by CodeRabbit