Skip to content

feat: add advance usage reset reminders - #64

Merged
mylee04 merged 2 commits into
mylee04:mainfrom
eltonylfgi-blip:feat/reset-time-reminders
Aug 28, 2026
Merged

mylee04 merged 2 commits into
mylee04:mainfrom
eltonylfgi-blip:feat/reset-time-reminders

Conversation

@eltonylfgi-blip

Copy link
Copy Markdown
Contributor

Summary

  • Add configurable advance reminders at 48h, 24h, 12h, 6h, 2h, and 30m before a provider-reported usage reset.
  • Dedupe reminders per reset cycle, collapse missed stages to one urgent catch-up, and suppress reminders while quota is full.
  • Document the commands and run the deterministic usage regression in macOS CI.

Why

Threshold alerts protect users once quota is nearly exhausted, but unused quota can still disappear at reset. This reuses the existing watcher, auth, and desktop/Slack/Discord delivery paths; it adds no service or dependency.

Behavior

  • cn usage setup --watch enables the default reminder schedule.
  • Weekly windows use every default stage; 5h windows use 2h and 30m.
  • cn usage reset-reminders set 24,6,1, off, and reset customize the schedule.
  • Unix-second, millisecond, and ISO-8601 reset timestamps are accepted.
  • Existing opt-in usage configs without the new key receive the default schedule.

Verification

  • PASS: tests/test-usage-alerts.sh under a Darwin/Python compatibility harness, including 48h, dedupe, late catch-up, 30m, and full-quota suppression.
  • PASS: Bash syntax for the executable and every library shell script.
  • PASS: git diff --check.
  • The full suite is not valid under this Windows-hosted platform emulation; this PR adds the targeted regression to native macOS CI for the authoritative run.

Send deduplicated reminders before configured reset milestones.

Cover late watcher catch-up, full-quota suppression, documentation, and macOS CI.
@mylee04 mylee04 added the enhancement New feature or request label Aug 28, 2026
@mylee04
mylee04 merged commit 6362475 into mylee04:main Aug 28, 2026
2 checks passed
@mylee04

mylee04 commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Thanks for the contribution, @eltonylfgi-blip! Merged.

I added 92adaf5 to preserve reminder dedupe history when quota temporarily returns to 100% within the same reset cycle. The regression tests cover 99% → 100% → 99% without repeating a reminder, and confirm reminders re-arm for the next reset cycle.

The full local test suite passed (28/28), and both GitHub Actions checks passed, including the usage-alert and reset-reminder regression tests.

@mylee04
mylee04 requested review from mylee04 and removed request for mylee04 August 28, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants