[Feature]: fair session ring across Anthropic OAuth, API keys, and Codex API pools
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- ai-infra-agents, authentication, backend
Direzione di ricerca
Start with the existing affinity and pool-session files named in the issue, then read the related issues #7738, #8098, and #7813 to understand the existing binding behavior. The request spans Anthropic OAuth, API-key pools, and Codex API pools, with persistence, failure handling, configuration, and diagnostics. Done means an opt-in ring assigns new sessions fairly, preserves session bindings across turns and restarts, and follows the listed quota and credential lifecycle rules.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Area
Authentication and account pool
What are you trying to accomplish?
We want fair, session-pinned rotation for new sessions across Anthropic OAuth accounts, Anthropic API-key pool entries, and Codex pool accounts. One session should stay on one credential while new sessions are spread evenly. This should work for Claude Code and Codex API clients.
What prevents this today?
Round-robin chooses a new account per request, and affinity only binds after a session key exists. There is no shared ring that assigns new sessions fairly and keeps each session pinned across the Anthropic OAuth pool, single-key Anthropic providers, and the Codex pool. Existing pieces are partial:
- Anthropic OAuth affinity persists bindings (
src/oauth/anthropic-session-affinity-store.ts). - The Claude Messages bridge now has a pool session (
src/server/claude-bridge-pool-session.ts). - Codex pool pins survive restarts (#8098).
- API-key cache affinity is proposed in #7738.
- None of these provides one fair ring across those credential families, including Codex API clients.
We run a local anthropic-session-ring patch for the Anthropic side and want to retire it once upstream provides the behavior.
What should OpenCodex do?
Add an opt-in per-provider session ring:
- Maintain an ordered ring of eligible credentials.
- Assign each new session to the next eligible credential.
- Keep the session on that credential across turns and proxy restarts.
- On a credential failure, cooldown, pause, reauthentication, or removal, advance the ring and rebind once.
- Preserve existing bindings and quota rules.
- Include Anthropic OAuth accounts, Anthropic API-key pool entries, and Codex pool accounts (Codex API/Responses).
- Use a bounded idle TTL and entry cap.
- Expose the selected credential and ring position in request logs or diagnostics.
Example usage or interface
{
"providers": {
"anthropic": {
"sessionRing": { "enabled": true, "idleTtlMs": 86400000 }
},
"codex": {
"sessionRing": { "enabled": true, "idleTtlMs": 86400000 }
}
}
}
ocx account pool anthropic --session-ring on
ocx account pool codex --session-ring on
Alternatives or workarounds
Round-robin without a ring moves a session between accounts. Affinity alone does not spread new sessions fairly across credential types. Running one credential per proxy instance avoids the problem but loses pool capacity.
Additional context
Related: #3375 (generic OAuth pool lifecycle), #7738 (API-key cache affinity), #8098 (Codex pool pins across restart), #8092 (round-robin quota headroom), #7813 (Anthropic affinity persistence). This request is the fair ring plus one-session-one-credential contract, including Codex API.
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.
- Lingua principale
- TypeScript
- Stelle
- 16.9k
- Fork
- 1.3k
- Merge medio
- 1g 4h
- PR unite (30g)
- 814
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lidge-jun/opencodex
-
bug gui platform
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
lidge-jun/opencodex#9172 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature]: Include provider, model and account label in the `upstream failure` service.log lineForse già presa @EnesKartal l’ha presa 4 giorni fa. Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
lidge-jun/opencodex#9057 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Provider] antigravity-acp catalog omits gemini-4-hydrogen and gemini-4-neon that agy acp offersForse già presa @sedoll l’ha presa 6 giorni fa. Apertacatalog provider provider-compatibility
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
lidge-jun/opencodex#9037 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug cli
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
lidge-jun/opencodex#9171 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
account-pool enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di lidge-jun/opencodex
Issue simili
-
manually bump balena-preload to ^19.0.6Forse già presa @shaunmulligan l’ha presa oggi. Aperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 66/100
balena-io/balena-cli#3200 ·
I maintainer di solito rispondono entro 1 giorno
-
`MaterializedChatMessage._text` is quadratic in the number of text chunks (`+=` followed by `endsWith`), driving the extension host to heap OOMForse già presa @olegius88 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
microsoft/vscode-prompt-tsx#205 ·
-
triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 64/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
melgarafael/DeskcommCRM#5340 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
ehmpathy/rhachet-roles-ehmpathy#1529 ·
I maintainer di solito rispondono entro 1 giorno