Support multiple plans for the same email#10
Closed
reyoung wants to merge 2 commits intoLoongphy:mainfrom
Closed
Conversation
Owner
|
Thanks for your work, but this has already been implemented in a related PR (#6), so I will be closing this one. Additionally, the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This update makes
codex-authsupport multiple accounts that share the same email but belong to different plans, such asteam,plus, orpro.It also fixes a follow-up regression in non-interactive switching:
codex-auth switch <selector>now matches aliases again, so selectors such asgmail_pluswork as expected.What changed
chatgpt:<email>#<plan>so same-email different-plan accounts can coexistaccount_idinstead ofactive_email, including auth file naming and registry lookupsswitchselector matching to cover alias, email,email#plan, account id, andapikey:<fingerprint>case-insensitivelyswitch [<selector>]instead of onlyemail-or-email#planValidation
zig build testzig build run -- listcodex-auth switch gmail_plususing the installed binary from~/.local/bin/codex-authNote
Support multiple plans for the same email by identifying accounts with a stable
account_idaccount_id— ChatGPT accounts usechatgpt:<email>#<plan>and API key accounts useapikey:<fingerprint>, allowing the same email to have distinct records per plan.account_id; registry version bumped from 2 to 3 with backward-compatible migration on load.switchcommand now accepts a flexible selector that matches by alias, email,email#plan, account ID, orapikey:<fingerprint>(case-insensitive substring).api_key_fingerprintonAccountRecord.active_email→active_account_id, auth files renamed toaccount_id-based paths); migration runs automatically on first load but is irreversible.Macroscope summarized 3e66ec9.