|
| 1 | +## Account Login |
| 2 | + |
| 3 | +### Bugfixes |
| 4 | + |
| 5 | +- Stopped `codex-multi-auth login` from always printing `Added account` when a |
| 6 | + same-email / different-workspace login folded onto an existing saved entry. |
| 7 | + The CLI login path used local copies of `resolveAccountSelection` and |
| 8 | + `persistAccountPool` in `lib/codex-manager.ts` that had drifted from the |
| 9 | + workspace-aware versions in `lib/runtime/` (added for #491 and used only by |
| 10 | + the runtime proxy); the CLI copies never persisted `workspaces` and |
| 11 | + unconditionally reported `Added account`. The login flow now reports the real |
| 12 | + outcome — `Added account`, `Updated existing account`, or |
| 13 | + `Rebound workspace for existing account` — based on whether the write |
| 14 | + inserted a new entry, refreshed an existing one, or surfaced a |
| 15 | + previously-untracked workspace (issue #512). |
| 16 | +- Persisted token-derived workspaces on the saved account so |
| 17 | + `codex-multi-auth workspace <account>` is usable after a same-email |
| 18 | + multi-workspace login. Rows no longer save with `workspaces: null`; |
| 19 | + per-workspace `enabled`/`disabledAt` state is preserved across re-logins, and |
| 20 | + the explicit `login --org <id>` binding now tracks workspaces too (previously |
| 21 | + the override path returned before workspace discovery). |
| 22 | +- Classified the first workspace-aware re-login of a pre-#491 account (one with |
| 23 | + no tracked workspaces yet) as `Updated existing account` rather than |
| 24 | + `Rebound workspace`, so quiet first-time enrichment is not mislabeled as a |
| 25 | + rebind. |
| 26 | + |
| 27 | +### Manual sign-in |
| 28 | + |
| 29 | +- Surfaced real validation errors from `codex-multi-auth login --manual` |
| 30 | + instead of reporting every failure as `Cancelled.`. The manual callback |
| 31 | + reader returned `null` for a genuine user cancel, a callback URL missing the |
| 32 | + code/state parameter, and an OAuth state mismatch alike, and the caller |
| 33 | + treated all three as a cancellation. A new pure classifier |
| 34 | + (`classifyManualCallbackInput`) distinguishes `code` / `cancelled` / |
| 35 | + `invalid` / `state-mismatch`; `invalid` and `state-mismatch` now exit non-zero |
| 36 | + with a specific, actionable message (`callbackInvalid` / |
| 37 | + `callbackStateMismatch`), while a genuine cancellation is unchanged |
| 38 | + (issue #512 follow-up). |
| 39 | + |
| 40 | +## Release Hygiene |
| 41 | + |
| 42 | +### Tests |
| 43 | + |
| 44 | +- Extracted the account-pool fold (dedup → insert/update/rebound → |
| 45 | + workspace-tracking → active-index) into pure helpers |
| 46 | + (`applyAccountPoolResults`, `buildInsertedAccount`, `buildUpdatedAccount`, |
| 47 | + `mergeAccountWorkspaces`, `resolveCurrentWorkspaceIndex`) and covered them with |
| 48 | + unit tests, including an end-to-end reproduction of the same-email |
| 49 | + multi-workspace scenario driven through the real `findMatchingAccountIndex` |
| 50 | + dedup strategy. |
| 51 | +- Added CLI regressions: `login --org <id>` persists workspace tracking, a |
| 52 | + mismatched manual-callback state exits non-zero with the state-mismatch |
| 53 | + message, and a malformed manual-callback URL exits non-zero with the |
| 54 | + `callbackInvalid` message — none of which persist an account. |
| 55 | +- Full classifier coverage for the manual-callback contract, including the |
| 56 | + reporter's "pasted a localhost callback URL but still saw Cancelled" case. |
| 57 | + |
| 58 | +### Notes |
| 59 | + |
| 60 | +- Prerelease published under the `beta` dist-tag |
| 61 | + (`npm i -g codex-multi-auth@beta`). This is a bugfix beta on the 2.3.0 line; |
| 62 | + the #509 sequential drain-first feature from `2.3.0-beta.0` is unchanged. |
0 commit comments