Skip to content

fix(alerts): suppress reset alert while blocking limit is at 100% - #262

Merged
aka-cronos merged 1 commit into
mainfrom
fix/alerts-suppress-blocked-reset
Nov 23, 2026
Merged

aka-cronos merged 1 commit into
mainfrom
fix/alerts-suppress-blocked-reset

Conversation

@aka-cronos

@aka-cronos aka-cronos commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

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 .limitReset while 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:
    • Added AlertQuota.scope (name for .limit(name, _), nil for account-wide periods), AlertQuota.isBlocked(by:), and AlertQuota.earliestUsableReset(of:).
    • Updated AlertTracker.observe to always clear awaitsReset on a confirmed reset, and only emit .limitReset when no other quota in the same reading blocks it.
  • app/UzzyCore/UsageCore.swift:
    • Updated scheduleResetVerification to use AlertQuota.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:
    • Added end-to-end tests in UsageAlertTests for 5-hour reset suppression while weekly stays at 100%, subsequent weekly reset firing, and reset verification scheduling.
    • Added AlertTrackerOverlapTests covering Antigravity model groups, named vs account-wide limits, new windows already at 100%, and earliestUsableReset edge cases.

Evidence

  • Commit 5ac0f7c:
    • Swift unit tests (xcodebuild test / swift test): not run locally (Swift toolchain is not installed on this Linux machine; runs in macOS CI on this PR).
    • No UI or copy changes.
Scenario Before After
Claude / Codex 5h resets while weekly is 100% Fires <Provider> ready to use again Suppressed; fires when weekly resets
Antigravity Gemini 5h resets while Gemini weekly is 100% Fires Antigravity ready to use again Suppressed; fires when Gemini weekly resets
Antigravity Gemini 5h resets while Claude and GPT weekly is 100% Fires Antigravity ready to use again Fires Antigravity ready to use again
5h (resets earlier) and weekly (resets later) both at 100% Schedules verification at 5h reset Schedules verification at weekly reset

Merge danger

Two-way door. Scoped to alert suppression and reset-verification scheduling inside UzzyCore with no persisted state, schema, auth, or copy changes. Worst-case blast radius is a missed or extra background reset notification.

Decisions

  • Suppress vs alternate copy: Suppressed the blocked reset alert instead of introducing alternate copy, matching the user goal of only being notified when the provider can actually be used again.
  • Scope-based blocking: Same-scope limits block each other, account-wide (scope == nil) limits block named limits, and separate named groups (such as Antigravity's Gemini and Claude and GPT, or Cursor's legacy bags) remain independent.

Not in this change

  • No changes to notification copy (Format.swift or Localizable.xcstrings).

Agents

Role Model Effort Tool Thread
Implementer Claude Opus 5.5 medium Claude Code in T3 Code thread:delegated-task:command%3Amcp%3A3422de16-0aae-4ed3-b901-8241eb06d53d%3Adelegate-task%3Aimpl-261-opus-1
Reviewer Gemini 4 Neon medium Antigravity in T3 Code f4ea617a-d890-4217-b02a-43925a7f0d20

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 .limitReset when an earlier window clears but another limit in the same scope is still at 100%.

AlertQuota gains scope-aware blocking (isBlocked(by:)) and earliestUsableReset(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). AlertTracker emits .limitReset only 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.

- 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.
@aka-cronos
aka-cronos merged commit 68f1a72 into main Nov 23, 2026
3 checks passed
@aka-cronos
aka-cronos deleted the fix/alerts-suppress-blocked-reset branch November 23, 2026 21:39
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.

Reset alert says "ready to use again" while another usage limit is still at 100%

1 participant