[Feature]: opt-in hosted-gateway account controls (served-account header, trusted pin, cross-process seat)
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
- 22/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- api, authentication
Direzione di ricerca
Read the account-pool selection path first: accountLogLabel in the request log, the active-account/affinity/strategy logic, and the per-process session-affinity snapshot added in #7828. Part 1 (a config-gated x-ocx-served-account response header) is the smallest slice and the only one worth starting from, once a maintainer agrees it fits dev; parts 2 and 3 change the auth surface and the round-robin seating rule and need design sign-off. Done means the flag is off by default and tests cover the header being absent when no pooled account was admitted. Note the thread is one day old with no maintainer reply yet.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Area
Authentication and account pool
What are you trying to accomplish?
I run OpenCodex as a hosted gateway that sits behind a multi-tenant app. The app needs three things the local single-user proxy does not:
- Attribution. After a turn, the app needs to know which pooled account served it so it can charge the right tenant. That means an opaque account label, never an email or a token.
- Pinning. The app needs to send a request on one specific stored account, for example the tenant's own Claude subscription, and have it refused rather than failed over when that account is spent.
- Stable placement across processes. Many gateway processes share no state (serverless environments). Each one must put the same session on the same pooled account, or the prompt cache is rebuilt whenever a turn lands on a different process.
What prevents this today?
- There is no response header naming the served account.
accountLogLabelalready exists for the request log, but it is not exposed to the caller. - There is no per-request account selector. Selection is process-wide: the active account, affinity, or the strategy.
- Session affinity is per process, plus the private snapshot added in #7828. That snapshot covers a restart on one machine, but not N processes without a shared home. Under
round-robin, an unbound keyed session gets a process-dependent pick.
What should OpenCodex do?
I propose three opt-in pieces. Each would be its own small PR, and each is off by default:
- Served-account header. Behind an explicit config flag, responses carry
x-ocx-served-account: <accountLogLabel>. That is the same non-PII label the request log already stores, and the header is absent when no pooled account was admitted. - Trusted-caller account pin. Behind a config flag, and only for callers authenticated with the admin or a dedicated token,
x-ocx-account-providerandx-ocx-account-idselect one stored account. A pinned request still records the refusal or cooldown, but it never fails over to another account. A malformed pin, or a pin from an untrusted caller, is refused with 400. It is never silently ignored. - Cross-process seat (round-robin only). An unbound keyed session takes the rendezvous-hash winner of
sha256(key \0 accountId)over the eligible accounts, so every process agrees without shared state. On a 429, the session that hit it moves to its hash runner-up. The process's startup selection does not seat a keyed round-robin session.
Example usage or interface
POST /v1/chat/completions
Authorization: Bearer <trusted gateway token>
x-ocx-account-provider: claude
x-ocx-account-id: <stored account id>
→ 200, x-ocx-served-account: anthropic (ab12cd3)
Alternatives or workarounds
The vadymhimself fork has shipped all three on a hosted gateway since 2026-10. There they are gated by an environment flag and use x-agentradar-* header names:
- the per-request pin and served-account header;
- the hash seat (0428964be2, b60e434917, 0c4ffad3e3).
Keeping them fork-only works, but every rebase costs a port.
Additional context
I'm asking whether any of the three fits dev before I write code. Part 1 is the smallest and safest, so if you're open to it, I'd start there. Part 2 changes the auth surface, so I'd expect it to need maintainer-sponsored. Header names and gating are open for discussion.
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