Skip to content

v2.17.0

Choose a tag to compare

@ndycode ndycode released this 25 Sep 22:58
· 340 commits to main since this release

v2.17.0

Fixes Codex CLI 0.156+ refusing every request with "selected workspace missing from routing discovery", and adds an opt-in native desktop binding with capability-aware routing, API/ZDR credential pools, subscription reset credits and a cross-provider mcodex resume picker.

Landed as #699, #701, #702, #703, #704 and #705, plus two Windows launcher fixes and a quota reset-time fix on main.

What's new

  • With runtime rotation on, interactive mcodex resume shows every saved session in the project, including desktop sessions saved under the openai provider that Codex's own picker hides. --all widens it to every directory and -C <dir> changes the project. Explicit session ids, --last, remote, non-interactive and in-session /resume behave as before, and if discovery fails you get the native picker. Needs a Codex version with app-server thread/list (#699).
  • rotation bind-app --native keeps the desktop app on its real OpenAI login, so Remote Control pairing and other account features keep working, while inference still goes through your account pool. It needs cli_auth_credentials_store = "file" in the same Codex home. --custom-provider or unbind-app rolls it back (#702).
  • In native mode, requests only go to an account and workspace whose catalog advertises the requested model, reasoning effort and speed. Catalogs refresh after 5 minutes, and a catalog outage never blocks inference (#702, #705).
  • Native mode also serves Responses over WebSockets, with the same auth, routing and usage tracking as HTTP. A sent request is never replayed after an ambiguous disconnect (#705).
  • Native subscription scheduling tries accounts above a 5% reserve first, then by priority tier, then by the earliest quota reset (#705).
  • login --api adds API and ZDR credentials as explicit api/<model> and zdr/<model> pools. Each pool fails closed when it runs out, and ordinary subscription requests never fall back to paid API credentials (#705).
  • fix --live repairs accounts saved before this release whose workspace Codex CLI now refuses (see Fixes) (#701).

New commands (#705):

Command What it does
check accounts / check resets / check capabilities Run one part of check. Unknown arguments exit 1.
check --prime Also send a tiny first-use request to unused Personal subscriptions. This starts their 5-hour and weekly windows and uses quota.
account priority <index> <0..9> Set a subscription account's tier. Lower goes first; the default is 1.
account auto-prime <index> on|off Let a running router prime this account every 15 minutes. Off by default.
resets list [--refresh] Show earned subscription reset credits per account.
resets redeem <account-number> Redeem one reset credit.
resets auto manual|last-resort last-resort redeems automatically only when every eligible subscription is blocked; manual (the default) never does.
login --api Add or edit API/ZDR credentials, their tiers and visible models.

Fixes

  • Codex CLI 0.156+ checks tokens.account_id in ~/.codex/auth.json against wham/accounts/check before every request. 2.16.0 wrote an org-sourced account's org-... id there, which is never a ChatGPT workspace, so every request failed after switch, best, rotation or login. auth.json now gets the token's chatgpt_account_id instead (#703, #700).
  • An auth.json that an older release already wrote with an org-... id is flagged as drift, and the next login dashboard render or doctor --fix rewrites it (#703).
  • Switching to an account with no saved workspace id no longer leaves the previous account's workspace id in auth.json next to the new tokens (#703).
  • best --live, forecast --live and report --live overwrote an explicit --org or org-sourced workspace with the token's default whenever they refreshed a token. They now keep it, like every other refresh path (#701).
  • On Windows, a token refresh whose accounts.json write kept failing (EBUSY or EPERM from a scanner or sync client) threw away the new refresh token, although the old one was already spent upstream, so the account needed a fresh login. The new token now stays live and is journaled to <accounts-file>.pending-auth.json (mode 0600) until a save lands (#705).
  • An absurd quota reset header (such as a 308-digit reset-after-seconds) overflowed to Infinity, so the window read as never resetting. Reset times are now capped at 7 days ahead and non-numeric ones are dropped, and wait times that can't be computed print as unknown instead of NaNs or Infinitym NaNs (45b7dd20).
  • On Windows, when package lookup and npm root -g both missed, the PATH scan only tried codex.exe and an extensionless codex. An npm prefix holds codex.cmd plus an extensionless sh shim, so launch failed. The scan now finds node_modules\@openai\codex\bin\codex.js behind the shim and runs it with node (ad59405c).
  • On Windows, CODEX_MULTI_AUTH_REAL_CODEX_BIN pointing at npm's codex.cmd or its sh shim failed every launch. It now resolves to the package's codex.js, or stops with a message naming codex.exe (933c1ff7).
  • On macOS and Linux, the app-server shim that codex app uses under runtime rotation was a hard link or copy of the Node binary in ~/.codex/multi-auth/app-server-shims/. A Node that loads its shared library relative to its own path, such as current Homebrew Node, could not start from there, so the desktop app's app-server launch failed. The shim now runs the original Node in place (#705).

Security

Heads up

  • New logins pick a uniquely identified Personal workspace over an organization default. 2.16.0 preferred the org default. With several workspaces and no unique Personal one, an interactive login asks you to choose, and cancelling saves nothing. A non-interactive login keeps the automatic choice and warns with the --org remedy.
  • login now asks wham/accounts/check whether the chosen workspace is authorized (one request, 10-second timeout, fails open). An unauthorized automatic choice is replaced by the backend's default account. An explicit --org or CODEX_AUTH_ACCOUNT_ID binding is saved as you chose it, but auth.json gets the authorized default and the login warns (#701).
  • Plain check now also refreshes reset credits and model discovery. API capability probes are billable, run only for credentials you opted in, and reuse results younger than 15 minutes. Only check capabilities forces them.
  • check now rejects unknown arguments with exit 1 (2.16.0 ignored them), so scripts passing extra flags to check need updating.
  • Nothing primes an unused subscription unless you ask: pass --prime, or turn on account auto-prime for that account. The dashboard's checks never prime. Priming uses subscription quota. API/ZDR credentials and reset credits are never used for it.
  • A switch pin stays strict in every mode, native included. Priority tiers, the 5% reserve and automatic reset redemption only apply when nothing is pinned. An unavailable pin fails with 503 codex_pinned_account_unavailable, and in native mode a pin refuses a model the pinned account doesn't advertise with 403 model_not_available_in_account_catalog.
  • status --json adds top-level apiAccounts, totalAccountCount, selectionMode and modelInventory, and per-account priority, autoPrime, lastInferenceRequestAt, reset-credit fields and forecast fields (forecastRiskScore, forecastRiskLevel, forecastQuotaUpdatedAt, selectionPreference, automaticOrder, subscriptionReserve, quotaResetAt, quotaDrainPerHour). fix --live --json reports rebound-unauthorized-workspace and codexActiveSynced.
  • Existing app binds keep their provider mode, also across reset-runtime. New binds stay on the custom provider unless you pass --native or set CODEX_MULTI_AUTH_NATIVE_OPENAI=1.
  • ws (8.21.3) is a new runtime dependency.
  • api-routes.json stores API keys in plain text (mode 0600 on macOS/Linux; Windows relies on your user profile's ACLs).
  • New local files: api-routes.json, reset-credits.json, api-capability-probes.json, inference-activity/, <accounts-file>.pending-auth.json and <accounts-file>.automatic-checks.json (hashed keys and attempt times only). uninstall --clear-accounts and the dashboard's delete-all reset remove all of them except automatic-checks.json.

Upgrade

npm i -g codex-multi-auth
codex-multi-auth --version

It should report 2.17.0.

If Codex CLI 0.156+ fails with "selected workspace missing from routing discovery", run:

codex-multi-auth fix --live

It checks each org-sourced account, rebinds any the backend no longer authorizes, and resyncs ~/.codex/auth.json when the active account changed. New logins need no extra step.

Downgrading: versions before 2.17.0 drop account priority tiers the next time they write any account policy. Re-run account priority after upgrading again. See docs/upgrade.md.

Thanks