Add configurable low-quota threshold actions (pause / desktop alert)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend
Research direction
Start by reading the existing quota threshold and proactive-switching behavior, then trace how quota observations, manual account pause, and quota-reset notification sinks work together. The issue names no files or tests, so locate those entry points before estimating the change. Done means selected quota windows can trigger the configured action, notifications include the requested quota details, and protected accounts are not routed new requests until manually resumed.
Written by the indexing model from the issue text.
Description
Area
Authentication and account pool / Dashboard / Platform notifications
What are you trying to accomplish?
I want OpenCodex to protect a Codex account before it is completely exhausted.
For example, if either the 5-hour or weekly quota reaches 80% used (20% remaining), I want OpenCodex to be able to automatically pause that account and/or alert me, instead of continuing to use it until the quota reaches 100%.
This is useful when I deliberately want to preserve the final part of my quota for later.
What prevents this today?
OpenCodex already has a configurable Usage threshold for proactive account switching, but that threshold is not a hard quota cutoff.
At the moment:
- the threshold can change the warning state in the quota UI;
- proactive switching can prefer a lower-usage eligible pool account;
- Pause exhausted applies when an account is effectively exhausted;
- there does not appear to be a setting that pauses an account when a configurable quota threshold is crossed;
- there does not appear to be a desktop/system notification specifically for crossing that threshold.
This is especially noticeable with only one account in the pool: crossing the proactive-switch threshold does not protect the remaining quota because there is nowhere else to switch.
What should OpenCodex do?
Please add a configurable action for crossing a quota threshold.
Example behavior:
Low quota threshold: 80% used
Actions:
- Warn only
- Desktop/system notification
- Pause account
- Pause account + notification
The action should trigger when any selected quota window reaches or exceeds the configured used percentage. At minimum this should support the 5-hour and weekly Codex windows.
For automatic pause, the account should stop being eligible for new requests once the threshold is crossed, just as if I manually pressed Pause. Ideally it should remain paused until I manually resume it, so OpenCodex does not unexpectedly consume the reserved quota.
A notification should identify:
- which account crossed the threshold;
- which quota window crossed it;
- current usage percentage;
- reset time if known.
It would also be useful if this threshold/action were independent of the existing proactive-switch threshold, since switching and reserving quota are different policies.
Example usage or interface
In Codex Set → Advanced settings, something like:
Low quota protection
[✓] Enable
Threshold: 80% used
When threshold is reached:
[✓] Pause account
[✓] Show desktop notification
Apply to:
[✓] 5-hour quota
[✓] Weekly quota
Example result:
Main Account paused — Weekly quota reached 81% used (19% remaining). Resets Sep 27 at 10:32.
If another eligible account exists, normal routing can continue through that account. If none exists, requests should not silently continue through the protected/paused account.
Alternatives or workarounds
The current workaround is to watch the quota bars manually and press Pause before usage reaches the desired reserve level.
The existing proactive-switch threshold helps when another eligible account exists, but it does not provide a hard stop for a single account and is not the same as reserving quota.
Additional context
Tested against OpenCodex v2.63.0.
Relevant existing pieces already appear to exist in the codebase:
- quota threshold / proactive switching;
- manual account pause;
- quota observation;
- quota reset notification sinks (webhook / local command).
This request is specifically for a quota-crossing threshold action, not quota-reset notification.
Checks
- I searched existing issues and documentation.
- This request describes a concrete OpenCodex workflow rather than merely naming a desired technology.
- I removed secrets and personal data.
- Dominant language
- TypeScript
- Stars
- 16.9k
- Forks
- 1.3k
- Avg merge
- 7h 34m
- Merged PRs (30d)
- 667
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from lidge-jun/opencodex
-
Transient OAuth login failure persists in getLoginStatus and masks active account in dashboardPossibly taken A pull request linked to this issue is open or already merged. Openaccount-pool bug gui
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
lidge-jun/opencodex#7378 · 2 comments ·
Maintainers usually reply within 1 day
-
account-pool enhancement needs-design proxy
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
lidge-jun/opencodex#6737 · 1 comment ·
Maintainers usually reply within 1 day
-
fix(google-antigravity): discoverAntigravityProject fails with missing_project when project is not auto-discovered, rejecting valid tokensPossibly taken @yobushka claimed this today. Openaccount-pool bug
Difficulty 3/5 1-2 days Newbie friendliness 35/100
lidge-jun/opencodex#7382 · 2 comments ·
Maintainers usually reply within 1 day
-
account-pool bug needs-design provider proxy
Difficulty 4/5 3-5 days Newbie friendliness 42/100
lidge-jun/opencodex#7380 · 3 comments ·
Maintainers usually reply within 1 day
-
[Bug] 2.88.0: opted-in pool account leaves rotation 5 min after its last credit read once its 5h window is full; requests fall to the hard-locked main accountPossibly taken A pull request linked to this issue is open or already merged. Openaccount-pool bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
lidge-jun/opencodex#7377 · 2 comments ·
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jessepollak/home#2223 ·
Maintainers usually reply within 1 day
-
grep fixture corpus test follows the corpus's loop symlink under the receipt runner (fails on main)Open
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
code-yeongyu/senpi#3756 ·
Maintainers usually reply within 1 day
-
org:external package:deepagents priority:triage topic:memory topic:middleware type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
langchain-ai/deepagents#7059 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
osmlab/name-suggestion-index#12992 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
hemilabs/ui-monorepo#2506 ·
Maintainers usually reply within 1 day