v2.3.0-beta.1.md

June 7, 2026 · View on GitHub

Account Login

Bugfixes

  • Stopped codex-multi-auth login from always printing Added account when a same-email / different-workspace login folded onto an existing saved entry. The CLI login path used local copies of resolveAccountSelection and persistAccountPool in lib/codex-manager.ts that had drifted from the workspace-aware versions in lib/runtime/ (added for #491 and used only by the runtime proxy); the CLI copies never persisted workspaces and unconditionally reported Added account. The login flow now reports the real outcome — Added account, Updated existing account, or Rebound workspace for existing account — based on whether the write inserted a new entry, refreshed an existing one, or surfaced a previously-untracked workspace (issue #512).
  • Persisted token-derived workspaces on the saved account so codex-multi-auth workspace <account> is usable after a same-email multi-workspace login. Rows no longer save with workspaces: null; per-workspace enabled/disabledAt state is preserved across re-logins, and the explicit login --org <id> binding now tracks workspaces too (previously the override path returned before workspace discovery).
  • Classified the first workspace-aware re-login of a pre-#491 account (one with no tracked workspaces yet) as Updated existing account rather than Rebound workspace, so quiet first-time enrichment is not mislabeled as a rebind.

Manual sign-in

  • Surfaced real validation errors from codex-multi-auth login --manual instead of reporting every failure as Cancelled.. The manual callback reader returned null for a genuine user cancel, a callback URL missing the code/state parameter, and an OAuth state mismatch alike, and the caller treated all three as a cancellation. A new pure classifier (classifyManualCallbackInput) distinguishes code / cancelled / invalid / state-mismatch; invalid and state-mismatch now exit non-zero with a specific, actionable message (callbackInvalid / callbackStateMismatch), while a genuine cancellation is unchanged (issue #512 follow-up).

Release Hygiene

Tests

  • Extracted the account-pool fold (dedup → insert/update/rebound → workspace-tracking → active-index) into pure helpers (applyAccountPoolResults, buildInsertedAccount, buildUpdatedAccount, mergeAccountWorkspaces, resolveCurrentWorkspaceIndex) and covered them with unit tests, including an end-to-end reproduction of the same-email multi-workspace scenario driven through the real findMatchingAccountIndex dedup strategy.
  • Added CLI regressions: login --org <id> persists workspace tracking, a mismatched manual-callback state exits non-zero with the state-mismatch message, and a malformed manual-callback URL exits non-zero with the callbackInvalid message — none of which persist an account.
  • Full classifier coverage for the manual-callback contract, including the reporter's "pasted a localhost callback URL but still saw Cancelled" case.

Notes

  • Prerelease published under the beta dist-tag (npm i -g codex-multi-auth@beta). This is a bugfix beta on the 2.3.0 line; the #509 sequential drain-first feature from 2.3.0-beta.0 is unchanged.