You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b507429
Browse filesBrowse the repository at this point in the historyBrowse files
Rebased onto current upstream/dev, integrating the exact-selector
routing that landed after this branch last merged dev. The pool
selection-order feature is unchanged: per-account priority tiers via a
single choke point in getEligiblePoolAccounts, the manual-selection pin,
preemption for unbound requests, and the CLI/GUI/config/docs surfaces.
Conflict resolution notes:
- src/codex/routing.ts: merged the PR's priority tiering with dev's
selectionOptions threading (exact-selector usability options). The
P2 scope-isolation fix (quotaScope through applyFailureFailover) is
preserved alongside dev's fixedAccount guards.
- src/config.ts: kept dev's apiKeys salvage + client-integrations
schemas and added the codexAccountPriorities / activeCodexAccountPinned
fields, write-path guard, and degraded-load warnings.
- src/codex/auth-api.ts: dev's newer listCodexAuthAccountsSnapshot
(main-identity generation, plan reconciliation) now threads priority
into the DTOs.
- gui/src/hooks/useCodexAccountPool.ts: dev's progressive-load base
gained the PR's priorityUpdatingId / activePinnedId / setAccountPriority
and the pin-lifecycle edges (switch/order cross-gate, pause release,
order-write pending-marker retirement).
- gui i18n + docs: kept the PR's corrected switch/pin copy and grafted
the selection-order docs into the restructured split pages in all
five locales.
Adds the exact-selector bypass regression: selection order must never
bypass an exact account selector. With codexAccountPriorities ordering
pool-b ahead of pool-a, an exact accountId: pool-a still resolves to
pool-a (fixedAccount), while the unbound pool path honors the order.
Verified: bun run typecheck, bun run privacy:scan, GUI tsc -b, GUI
eslint + lint:i18n, GUI suite (645 pass), core pool/config/cli tests.
Pre-existing Windows symlink-EPERM and load-sensitive auth-api ordering
failures reproduce identically on the clean dev base and are not
introduced here.
Copy file name to clipboardExpand all lines: README.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,6 +60,12 @@ ocx start # or `ocx service` to run it in the backgro
60
60
Open **http://localhost:10100** and configure everything in the web dashboard — add providers
61
61
(40+ built-ins, or any OpenAI-compatible endpoint), pick models, manage accounts. `ocx gui`
62
62
re-opens the dashboard at any time.
63
+
It can also manage a **ChatGPT account pool** for Codex auth. Add multiple ChatGPT / Codex accounts,
64
+
refresh their 5h / weekly / 30d quota in the dashboard, and let new sessions auto-route to the
65
+
lowest-usage healthy account. Existing Codex threads stay pinned to the account that started them,
66
+
so long SSH, tmux, or mobile-connected sessions do not jump accounts mid-conversation. Give the
67
+
accounts a selection order when one of them — usually your Codex Desktop login — should only be
Copy file name to clipboardExpand all lines: docs-site/src/content/docs/guides/web-dashboard.md
+11-2Lines changed: 11 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,8 +105,16 @@ catalog entry.
105
105
106
106
The **Codex Auth** page manages the native ChatGPT/Codex route:
107
107
108
-
- Manually choosing an account changes the next new Codex session; an already-bound thread keeps its
109
-
current account for that manual switch.
108
+
- Manually choosing an account applies immediately: an already-bound thread moves to it on its next
109
+
request, and only requests already in flight keep the account they captured. A manual choice is also
110
+
pinned: the card shows a **PINNED** badge, and a higher selection order cannot preempt that account
111
+
until it is drained, you select another account, or you change any account's selection order.
112
+
- Each account card carries a **Selection order** control (First, Earlier, Normal, Later, Last).
113
+
Higher order is used first, and the pool drops to a lower order only once every account above it is
114
+
drained or unavailable. A changed order applies from the next unbound request and never moves a
115
+
thread that is already bound. The Codex Desktop (main) account is ordered like any other, so it can
116
+
be set to **Last** and kept as the reserve. An order set from `ocx account priority` outside those
117
+
five presets stays visible and selectable on the card.
110
118
- Thread affinity prevents per-request flapping. With quota auto-switch enabled, a long-running
111
119
thread is periodically re-evaluated and may rebind after its relevant usage reaches the threshold
112
120
and a strictly lower-usage eligible account exists.
@@ -170,6 +178,7 @@ The GUI is a thin client over the proxy's JSON management API. Useful endpoints
170
178
|`POST /api/oauth/login` · `GET /api/oauth/status`| Start a provider OAuth flow and poll for completion. |
171
179
|`GET /api/codex-auth/accounts?refresh=1`| List main and pool accounts, force quota refresh, and report main-account `hasCredential` / terminal `needsReauth` state. |
172
180
|`PUT /api/codex-auth/active` · `PUT /api/codex-auth/auto-switch` · `PUT /api/codex-auth/failover`| Select the account for the next request and configure pool routing. |
181
+
|`GET /api/codex-auth/active` · `PUT /api/codex-auth/accounts/priority`| Read the effective account (including `pinned` and which account is `pinnedAccountId`) and set one account's selection order. |
173
182
|`POST /api/codex-auth/login` · `GET /api/codex-auth/login-status`| Add a pool account through browser login. |
174
183
|`GET /api/logs?tail=50&limit=20&offset=0&provider=...&status=5xx`| Read recent request metadata with optional tail, provider, and exact/class status filters. With `limit`/`offset`, paging walks backward from the newest row (`offset=0` returns the latest page). Response shape: `{ timeZone, total, logs }` where `total` is the filtered row count before pagination. |
175
184
|`GET` / `PUT /api/subagent-models`| Read or set the five featured `spawn_agent` override models. |
使い切るまで維持します。ただし再認証エラー、quota cooldown、一時的な失敗の連続はそれより早く紐付けを解除します。受理された書き込みは、どのアカウントの手動の「今すぐこのアカウントを使う」固定も解除します。すでに設定済みの順序を書き込んだ場合も同様で、これは現在選択中のアカウントを保ったまま固定を解除する唯一の方法です(管理 API でアクティブアカウントを解除しても固定は解除されますが、その選択自体も失われます)。プロキシに接続できない場合、
0 commit comments