Repository navigation
fix(claude): bound usage reset tracking, prevent statusline freeze/false resets, and scope account-switch ask toasts - #51603
Merged
Conversation
…lse resets, and scope account-switch ask toasts (STA-16710, STA-16722, STA-16732)
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
Fixes three 1.4.267 delta release-scan issues in Claude usage tracking, statusline ingestion, and account-switch restart toasts:
ClaudeLiveUsageSessionReportsreset-adoption (adoptedBy) sets to the 64-session LRU cap, remove evicted session IDs fromadoptedBy, capresetByWindow, and prune expired reset windows onceresetsAt <= now.!hasChanged(...)withisUnchanged(...)inRateLimitServiceFetchPolicy.ingestLiveClaudeRateLimitsso unseen/new sessions andsession_id-less statusline posts are not frozen for the remainder of a same-window reset while idle pre-reset sessions repeating their snapshot remain blocked.paneKeyinreadClaudeStatusLineRateLimitsand key session reports by(paneKey, sessionId)so a single resumed conversation open in two panes cannot interleave into a fabricated quota reset.askIdand the exactptyIdsset to each host account-switch Ask (ClaudeHostRunningSessionsMove.askId,AskedClaudeMove), verifyanswersAskIdinansweredClaudeMove, and restrict restart execution to the Ask's capturedptyIds.claude-account-switch-sessions.tsand dismiss/replace prior Ask toasts by stable toast ID so an older restart toast cannot stop a different switch's sessions.Performance
resetByWindow[*].adoptedByand stale expired entries inresetByWindowacross long-lived sessions (capped at 64 sessions / 64 reset windows, pruned on expiry and LRU eviction).Verification
pnpm check:changed: 42/42 checks passed (format, oxlint, typecheck, changed-code quality, unit tests including new invariant tests inclaude-live-usage-session-reports.test.tsandclaude-host-account-switch.test.ts, RPC params catalog, localization, and all ratchets).