Skip to content

fix(notifications): show best quota and earliest reset - #241

Open
lubshad wants to merge 2 commits into
ndycode:mainfrom
lubshad:fix/quota-best-limit-earliest-reset
Open

fix(notifications): show best quota and earliest reset#241
lubshad wants to merge 2 commits into
ndycode:mainfrom
lubshad:fix/quota-best-limit-earliest-reset

Conversation

@lubshad

@lubshad lubshad commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • select the highest remaining quota and earliest future reset independently for each quota window
  • preserve disabled-window and expired-reset filtering
  • update tests and documentation for the pool-wide aggregation behavior

Verification

  • npm test -- quota-notifications
  • npm test -- doc-parity
  • npm run typecheck
  • npm run lint
  • git diff --check

Summary by CodeRabbit

  • Bug Fixes

    • Quota notifications now independently report the highest remaining quota percentage and earliest reset time across enabled accounts for 5-hour and weekly windows.
    • Notifications may combine values from different accounts for more accurate availability information.
  • Documentation

    • Updated the README and configuration guide to explain the revised behavior.
  • Tests

    • Added coverage for independent quota and reset selection.

note: greptile review for oc-chatgpt-multi-auth. cite files like lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.

Greptile Summary

the pr independently selects the highest remaining quota and earliest valid future reset across enabled accounts.

  • preserves filtering for disabled windows, invalid usage, and expired resets
  • adds focused vitest coverage for the previously reported invalid-usage reset case
  • updates quota aggregation documentation and release notes

Confidence Score: 5/5

the pr appears safe to merge.

no blocking failure remains.

Important Files Changed

Filename Overview
lib/quota-notifications.ts the reset calculation is independent across scorable windows while remaining guarded by valid usage and enabled-window checks.
test/quota-notifications.test.ts focused vitest coverage verifies cross-account aggregation and excludes resets from windows without valid usage.
README.md documents that percentage and reset values may represent different enabled accounts.
docs/configuration.md configuration guidance matches the revised pool-wide aggregation behavior.

Reviews (2): Last reviewed commit: "fix(notifications): ignore resets withou..." | Re-trigger Greptile

@lubshad
lubshad requested a review from ndycode as a code owner September 1, 2026 06:53
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@coderabbitai

coderabbitai Bot commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 4eb6db1d-5bfe-4c55-ae83-f47b45b4efd4

📥 Commits

Reviewing files that changed from the base of the PR and between 185ffc6 and 36294e2.

📒 Files selected for processing (2)
  • lib/quota-notifications.ts
  • test/quota-notifications.test.ts

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Quota notifications now select the highest remaining percentage and earliest valid reset independently across enabled accounts. Tests cover different source accounts and invalid usage data. Documentation describes the updated behavior.

Changes

Quota notification aggregation

Layer / File(s) Summary
Independent aggregation and validation
lib/quota-notifications.ts, test/quota-notifications.test.ts
aggregateWindow independently selects maximum remaining quota and earliest valid reset time. Tests cover different source accounts and ignore resets from accounts without valid usage.
Quota notification documentation
README.md, docs/configuration.md, CHANGELOG.md
Documentation and the changelog describe the updated aggregation behavior for 5-hour and weekly quota notifications.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 36294

The change updates quota notifications to choose the highest remaining quota and earliest future reset across eligible windows while preserving existing filters; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: ndycode

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the primary change: independently reporting the best quota and earliest reset.
Description check ✅ Passed The description includes the change summary, verification commands, regression scope, and documentation updates. It omits the template's Compliance Confirmation and Notes sections, and uses "Verificat…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Description check

Explanation

The description includes the change summary, verification commands, regression scope, and documentation updates. It omits the template's Compliance Confirmation and Notes sections, and uses "Verification" instead of "Testing," but it remains mostly complete and relevant.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread lib/quota-notifications.ts
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.

1 participant