Universal usage cap for every provider, with lane failover when the cap is reached
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- backend-api-design
Research direction
Start by tracing the existing auto-switch implementations for OpenAI/ChatGPT and Anthropic referenced by issues #6013 and #6207, then follow how combo/* lanes handle 429 and 402 failures. Determine where provider quota state and lane selection meet; done means quota-reporting providers honor the shared cap and overrides, and lanes move to the next configured provider once the account reaches its cap. This spans multiple provider pools and routing behavior, so it needs project familiarity.
Written by the indexing model from the issue text.
Description
Area
Authentication and account pool
What are you trying to accomplish?
Use one consistent percentage-based usage cap across every provider that reports quota (including google-antigravity), with optional per-provider or per-account overrides, and have combo/* lanes automatically fail over to the next configured provider as soon as an account reaches its cap.
What prevents this today?
Usage caps (auto-switch threshold) are only implemented for some pools today (such as OpenAI/ChatGPT and Anthropic pools via #6013 and #6207). On ocx 2.100.10, running ocx account auto-switch google-antigravity status reports:
auto-switch: inactive (stored threshold unset; not applied by this pool)
In addition, combo/* lanes currently only switch to the next provider on a 429 or 402 error, so an account continues receiving lane traffic until its quota is completely exhausted.
What should OpenCodex do?
- Provide one universal percentage cap system (
auto-switch) that works the same way for every quota-reporting provider (includinggoogle-antigravity), with optional overrides per provider and per account (--account <id>). - Integrate cap state into
combo/*lane routing so that when an account passes its configured cap percentage, the lane moves to its next configured provider before hitting a429or402exhaustion error.
Example usage or interface
# Set a default cap across all quota-reporting providers (proposed)
ocx account auto-switch threshold 80
# Optional per-provider or per-account overrides using the existing command shape
ocx account auto-switch google-antigravity threshold 85
ocx account auto-switch openai threshold 90 --account <id>
Before: a combo/* lane keeps routing to the current provider until a request fails with 429 or 402.
After: once an account reaches its configured cap (e.g. 80%), the lane routes subsequent requests to the next target provider while leaving headroom on the capped account.
Alternatives or workarounds
Manually checking quota per pool and switching providers or accounts by hand, or relying on reactive 429/402 fallback in combo/* lanes after an account is already exhausted.
Additional context
- Related issues/PRs: #6013, #6207
- Environment: macOS (Apple Silicon),
opencodex 2.100.10 - Happy to test a build or PR on macOS (Apple Silicon,
ocx 2.100.10).
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
- 1d 4h
- Merged PRs (30d)
- 814
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
-
bug gui platform
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
lidge-jun/opencodex#9172 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log linePossibly taken @EnesKartal claimed this 4 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lidge-jun/opencodex#9057 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersPossibly taken @sedoll claimed this 6 days ago. Opencatalog provider provider-compatibility
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
lidge-jun/opencodex#9037 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug cli
Difficulty 4/5 3-5 days Newbie friendliness 52/100
lidge-jun/opencodex#9171 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
account-pool enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in lidge-jun/opencodex
Similar issues
-
manually bump balena-preload to ^19.0.6Possibly taken @shaunmulligan claimed this today. Open
Difficulty 1/5 1-3 hours Newbie friendliness 66/100
balena-io/balena-cli#3200 ·
Maintainers usually reply within 1 day
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOMPossibly taken @olegius88 claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
Difficulty 1/5 Under an hour Newbie friendliness 64/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
melgarafael/DeskcommCRM#5340 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
ehmpathy/rhachet-roles-ehmpathy#1529 ·
Maintainers usually reply within 1 day