Skip to content

Same email + different workspace login says 'Added account' but overwrites existing saved entry #512

@adithya04dev

Description

@adithya04dev

Summary

When I add another account through codex-multi-auth login, the CLI reports Added account, but if the login is for a different workspace on the same email, the saved account count does not increase.

Instead, the existing saved entry for that email/account family appears to be refreshed or overwritten.

Actual behavior

I can reproduce this with multiple workspaces under the same email:

  1. Run codex-multi-auth login
  2. Choose Open Browser (Easy) or Manual / Incognito
  3. Log into a different workspace using the same underlying email
  4. The CLI prints:
Added account. Total: 3
Next steps:
  codex-multi-auth status
  codex-multi-auth check
  codex-multi-auth list
  1. After exiting the flow and running codex-multi-auth status, the total is still 3
  2. The newly added workspace did not become a separate saved slot; an existing entry appears to have been updated instead

Expected behavior

One of these should happen consistently:

  1. If workspace-scoped accounts are intended to be distinct, adding a different workspace on the same email should create a separate saved entry
  2. If same-email workspaces are intentionally merged, the login flow should not say Added account when it is actually updating/rebinding an existing saved entry

Right now the UX strongly suggests a new saved account was created, but local storage remains flat.

Local observations

On my machine, repeated browser logins for a different workspace on the same email updated existing saved identities instead of appending a new one.

The stored pool remained at 3 accounts even after successfully completing additional browser logins.

This seems related to deduplication/matching on save rather than a failed OAuth callback.

Why this is confusing

For users with:

  • one email
  • multiple ChatGPT/OpenAI workspaces

it looks like the tool supports adding another account/workspace, but the saved account count and final stored state do not reflect that mental model.

Suggested fix

At minimum, the login flow should distinguish between:

  • Added account
  • Updated existing account
  • Rebound workspace for existing account

If per-workspace saved entries are a supported goal, then same-email workspaces should be representable as distinct stored entries.

Environment

  • codex-multi-auth: 2.2.2
  • Official Codex CLI in use through the multi-auth wrapper
  • Reproduced on macOS

Additional context

I also observed that status and the dashboard can present slightly different-looking account ordering/state, which makes this even harder to understand during testing. The core bug here, though, is that the browser flow reports Added account while the stored account total does not increase for same-email different-workspace logins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions