Repository navigation
fix(alerts): suppress reset alert while blocking limit is at 100% - #262
Merged
Merged
Conversation
- Suppress .limitReset when another blocking quota in the same scope (or an account-wide quota) is still at 100%, while still clearing awaitsReset on the reset window. - Skip early reset verification scheduling for limited quotas that another blocking limit at 100% outlasts. - Add unit and end-to-end tests for overlapping windows and model groups.
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.
When a provider has overlapping usage windows (such as 5-hour and weekly on Claude or Codex, or 5-hour and weekly within an Antigravity model group) and the 5-hour limit resets while the weekly limit is still at 100%, Uzzy fired a reset notification saying the provider was "ready to use again". This change suppresses
.limitResetwhile another blocking limit in the same reading is still at 100%, and skips scheduling an early reset verification for blocked resets.Closes #261
Summary
app/UzzyCore/Alerts.swift:AlertQuota.scope(namefor.limit(name, _),nilfor account-wide periods),AlertQuota.isBlocked(by:), andAlertQuota.earliestUsableReset(of:).AlertTracker.observeto always clearawaitsReseton a confirmed reset, and only emit.limitResetwhen no other quota in the same reading blocks it.app/UzzyCore/UsageCore.swift:scheduleResetVerificationto useAlertQuota.earliestUsableReset(of:)so it does not schedule an early verification query for a reset outlasted by a blocking limit at 100%.app/UzzyCoreTests/UsageAlertTests.swift:UsageAlertTestsfor 5-hour reset suppression while weekly stays at 100%, subsequent weekly reset firing, and reset verification scheduling.AlertTrackerOverlapTestscovering Antigravity model groups, named vs account-wide limits, new windows already at 100%, andearliestUsableResetedge cases.Evidence
5ac0f7c:xcodebuild test/swift test): not run locally (Swift toolchain is not installed on this Linux machine; runs in macOS CI on this PR).<Provider> ready to use againGemini5h resets whileGeminiweekly is 100%Antigravity ready to use againGeminiweekly resetsGemini5h resets whileClaude and GPTweekly is 100%Antigravity ready to use againAntigravity ready to use againMerge danger
Two-way door. Scoped to alert suppression and reset-verification scheduling inside
UzzyCorewith no persisted state, schema, auth, or copy changes. Worst-case blast radius is a missed or extra background reset notification.Decisions
scope == nil) limits block named limits, and separate named groups (such as Antigravity'sGeminiandClaude and GPT, or Cursor's legacy bags) remain independent.Not in this change
Format.swiftorLocalizable.xcstrings).Agents
Note
Low Risk
Changes are confined to in-memory alert and reset-verification scheduling in UzzyCore with no persisted state; worst case is an incorrect or missing background limit-reset notification.
Overview
Overlapping usage limits (e.g. 5-hour and weekly, or per-model groups on Antigravity) no longer trigger a ready to use again
.limitResetwhen an earlier window clears but another limit in the same scope is still at 100%.AlertQuotagains scope-aware blocking (isBlocked(by:)) andearliestUsableReset(of:)so only the reset after which the provider is actually usable drives alerts and background reset verification scheduling (replacing the previous “earliest limited reset” minimum).AlertTrackeremits.limitResetonly when no sibling quota in the reading still blocks that period.New unit and integration tests cover Codex 5h/weekly overlap, Antigravity model groups, named vs account-wide limits, and edge cases for usable-reset selection.
Reviewed by Cursor Bugbot for commit 5ac0f7c. Bugbot is set up for automated code reviews on this repo. Configure here.