Skip to content

Add configurable low-quota threshold actions (pause / desktop alert) #5649

Description

@Quest79

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.

Activity

  1. Ingwannu commented on Sep 23, 2026

    @Ingwannu
    Owner

    This is a valid policy gap, not the same setting as proactive account switching. The current threshold can prefer another eligible account, but it does not create a durable manual pause for the single-account case. A safe implementation should keep the reserve threshold separate from switching, make the pause transition idempotent per account/window crossing, never auto-resume a user-reserved account at reset unless explicitly configured, and emit notification data without credential/account-secret fields. The no-eligible-account response must be explicit rather than silently borrowing the protected account. I am keeping this open as an enhancement; the remaining maintainer decision is whether v1 should ship pause-only first or pause plus desktop notification in one change.

  2. added
    priority: P3Low: new provider/client integration, large or experimental feature (>2000 LOC or >50 files), RFC/ro
    on Sep 24, 2026
  3. devin-ai-integration commented on Sep 24, 2026

    @devin-ai-integration
    Contributor

    Triage: priority: P3 — low-quota threshold actions.

    Criteria (P3): Low: new provider/client integration, large or experimental feature (>2000 LOC or >50 files), RFC/roadmap, or long-stale branch.

    Matched pull requests:

  4. added 2 commits that reference this issue on Sep 26, 2026
    b500e6d
    b05e99d
  5. lidge-jun commented on Sep 27, 2026

    @lidge-jun
    Owner

    Release train 4 (account-pool lane) is keeping this open. What shipped this train is a manual pause for generic OAuth accounts (#6106). It does not add a low-quota threshold action, an alert with account or reset context, or a settled resume. #5956 is the candidate for this and is on hold for the reasons in its review thread. Whatever lands here should keep the reserve threshold separate from proactive switching, make the pause idempotent per account and window, and never loosen the 98% main-account hard lock.

  6. lidge-jun commented on Oct 4, 2026

    @lidge-jun
    Owner

    Status update after checking dev at 0818ea1: the low-quota pool policy has landed through #6182 (f991131), superseding the earlier #5956 candidate. It supports threshold/window actions and a persisted pause with manual-resume behavior. The implementation and regressions are in src/codex/low-quota-protection.ts and tests/codex-integration/low-quota-protection.test.ts.

    Keeping this issue open for its remaining desktop/system notification acceptance. The current notify path reaches local logs and authenticated event history; the documented default is logged, not OS delivery. This is a partial implementation update, not a claim that the entire request or native notification behavior is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    account-poolOAuth, credentials, Codex pool, quota, failover, plansenhancementNew feature or requestpriority: P3Low: new provider/client integration, large or experimental feature (>2000 LOC or >50 files), RFC/ro

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions