Skip to content

[feature] Support registering multiple workspaces for the same email (personal + business/team under one Google account) #491

@MarsGao

Description

@MarsGao

Background

Issues #100 and #121 touched this topic. #121 was closed with fix in b918aac, which addressed quota-cache display for same-email multi-workspace entries that were already stored. However, the registration path (i.e., running codex-multi-auth login to add a second workspace for an email that already has one) remains unsupported.

Use Case

A user has a single Google/OpenAI account (user@gmail.com) that belongs to two separate ChatGPT workspaces:

  • Personal Plus – individual subscription, org_id = org-AAAA
  • Business / Team workspace – organization subscription, org_id = org-BBBB

Both workspaces are distinct quota pools. The user wants to track and rotate between them independently, just like two separate email accounts.

Current Behavior

  1. codex-multi-auth login with user@gmail.com → OAuth completes for one workspace (e.g., Business) → stored as Account N.
  2. Running codex-multi-auth login again for the same email (Personal Plus workspace) either:
    • Overwrites Account N (loses the Business workspace entry), or
    • Blocks the addition because the duplicate-email doctor check treats email as the unique key.
  3. The accounts.json schema has no workspaceName/workspaceId field populated, so there is no way to distinguish the two entries even if both were stored.

Expected Behavior

Option A – Workspace selection during login: when codex-multi-auth login detects the OAuth response belongs to an email already registered but with a different accountId (org_id), prompt the user to confirm adding it as a new entry rather than overwriting.

Option B – Explicit workspace flag: codex-multi-auth login --new-workspace or codex-multi-auth login --org <org_id> to force-create a second entry for the same email.

Either way, the stored entry should include a workspaceName or workspaceLabel field so codex-multi-auth list can distinguish:

1. user@gmail.com  [Personal Plus]   org-AAAA
2. user@gmail.com  [GkTech Business] org-BBBB

Environment

  • codex-multi-auth version: 2.1.12
  • @openai/codex version: 0.135.0
  • OS: Windows 11 Enterprise
  • Node.js: (via C:\nodejs)

Diagnostics

Current accounts.json structure (sanitized):

{
  "accounts": [
    { "email": "user@gmail.com", "accountId": "org-AAAA", "workspaceName": "" },
    { "email": "user@gmail.com", "accountId": "org-BBBB", "workspaceName": "" }
  ]
}

The workspaceName field is always empty even after login, making it impossible to label or distinguish same-email entries.

Related Issues

Compliance

  • I am using this project for personal development workflows (multiple ChatGPT subscriptions owned by the same person).
  • This request does not ask for credential sharing, policy bypass, or resale use.
  • No secrets or tokens are included in this report.

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