Repository navigation
fix(account-pool): reject duplicate OAuth account imports - #5709
Closed
MayankBansal12 wants to merge 4 commits into
Closed
MayankBansal12 wants to merge 4 commits into
MayankBansal12 wants to merge 4 commits into
Conversation
MayankBansal12
marked this pull request as ready for review
October 17, 2026 22:00
This was referenced Oct 23, 2026
Contributor
|
This is an automated message. We have closed this pull request because it has been open for more than two weeks. |
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.
Human comments
this PR prevents from duplicate imports for the same account by comparing accountId/emails for codex and claude accounts
Review Note:
One Claude login may have access to multiple organizations with separate usage limits. If those logins share the same account ID, this fix could mistakenly block adding the second organization to the pool. I couldn’t reproduce the Claude multi-organization edge case so it remains unverified.
What was wrong
Importing the same machine login repeatedly created duplicate Account Pooler entries because account creation always appended a record without checking whether the account was already connected.
What changed
Reject duplicate OAuth accounts inside the existing serialized store operation, before writing credentials. Explicit comparisons use provider identity first, then case-insensitive email, then tokens when metadata is missing. Distinct Codex workspace IDs remain separate. Rejected additions preserve the existing account, including its enabled state and priority. Codex device login surfaces the duplicate error. No daemon protocol or public API changes.
Tests cover each matching rule separately, with one concurrent-add regression for locking and orphan-secret prevention. Removed repeated RPC coverage of the same store behavior. Opus 5.5 at high implemented the readability pass.
How you verified
pnpm exec turbo run test typecheck lint --filter=bb-plugin-account-pool: 364 tests across 12 files passed; typecheck and lint passed (two existing warnings in unchanged UI files).git diff --checkpassed.