Repository navigation
Description
Client or integration
OpenCodex dashboard
Area
Authentication and account pool
Summary
I am trying to keep two Kiro accounts belonging to two different users in the same organization in the OpenCodex account pool.
I used the dashboard's Kiro CLI import/login option and completed the second user's login using a different Chrome profile. OpenCodex reported a duplicate account during the import, and I could not retain the second user as a separate account. The duplicate message came from OCX's import flow, not the organization's login page.
I expected two distinct organization users to remain independently selectable in the Kiro account pool.
Reproduction
Steps from the observed attempt; a controlled second reproduction with before/after identity comparison has not yet been captured:
- Have one organization-backed Kiro account imported into OCX.
- Attempt to add the second user from the same organization through the dashboard's Kiro CLI option.
- Complete authentication using the second user's Chrome profile.
- Observe OCX report a duplicate during import rather than retain two distinct accounts.
The dashboard offers Kiro CLI, Builder ID, Google, and GitHub. The Builder ID path did not offer the organization login option I need, which is why I used Kiro CLI.
Version
OpenCodex 2.77.0
Kiro CLI 2.27.1
Operating system
macOS 27.0.1, arm64
Provider and model
Kiro — organization login / multi-account import. No inference model is involved in the failing step.
Logs or error output
The error was described as an account-duplicate message. I do not have its exact wording captured, so this report does not quote an invented error string.
Subsequent local inspection found one stored Kiro account. Its non-secret metadata shows:
- credential source:
local-cli - no stored email
- an account ID and a Kiro profile ARN are present
- the stored account ID equals the stored profile ARN
Code inspection / hypothesis, not a confirmed root cause
In the installed 2.77.0 source:
src/oauth/kiro.ts,oauthCredentialFromImported(), assigns the resolved profile ARN tocredential.accountId.src/oauth/store.ts,saveCredentialWithReceipt(), matches identities usingaccountId ?? email. A matching identity updates the existing slot rather than appending another account.
Could two different organization users share a profile ARN, or could CLI import resolve both logins to the same ARN? If so, this identity rule could conflate the users. I have not compared both users' imported ARNs, so neither shared ARN nor stale-session reuse is confirmed. Please also check whether this dashboard path imports an existing CLI session instead of obtaining the intended second user's identity.
Related: #4435 was fixed via #4482 for a leftover CLI profile ARN collapsing a second account. This report concerns the organization-user case on 2.77.0; I am not claiming it has the same root cause or is a confirmed regression.
Requested investigation
Please verify distinct-user handling in the organization/SSO Kiro CLI import path. If profile ARN is not a unique user identity for this case, account identity should be separated from request-routing profile metadata. Clear diagnostics should distinguish reimporting the same user from an identity collision between different users.
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
Ingwannu commentedon Oct 6, 2026
The current dev import still assigns the resolved Kiro profile ARN to accountId, and the shared store uses accountId before email for its upsert identity. The import also checks that CLI whoami still belongs to the imported SQLite session; this guards one session-switch race but does not prove that an organization profile ARN identifies a distinct user.
Please capture the exact redacted duplicate message and compare the two imports locally: report only whether the intended user identity, profile ARN and CLI session changed (same/different), not the actual ARN, email, tokens or credential-file contents. Also confirm whether the Kiro CLI itself reports the intended second user immediately before import; changing the browser profile alone does not establish which session is stored by the CLI.
That will distinguish reimporting one active CLI session from a genuine distinct-user identity collision. Keeping this open without treating #4435/#4482 as proof of the same cause. No live login, credential import, store write or security scan was performed.
fix(kiro): keep same-organization users as separate accounts (#6981)
lidge-jun commentedon Oct 12, 2026
#6981 is now on
dev(8d12a3c). Kiro accounts are now identified by the profile ARN plus the email that the same CLI session'skiro-cli whoami --format jsonreports, so a second user of the same organization profile gets their own slot instead of overwriting the first.\n\nThis only helps ifwhoamiactually reports the user's email for your IAM Identity Center login, and that has not been confirmed against Kiro CLI 2.27.1. Could you runkiro-cli whoami --format jsonfor each of the two users and post only the field names and whetheremailis present and non-null? Please don't include the email values, tokens, ARNs or start URLs. Ifemailis missing, the two users still look identical to OpenCodex, and we will need a different identity source. The issue stays open until that is confirmed.lidge-jun commentedon Oct 13, 2026
This was fixed on
devby #6981 (8d12a3c, "fix(kiro): keep same-organization users as separate accounts"). Kiro account identity is now the profile ARN plus the email that same-sessionkiro-cli whoamireports, so a second user of the same IAM Identity Center profile gets its own slot instead of being reported as a duplicate. It ships in the next release after 2.84.0.One caveat from that PR: the separation depends on
whoamireporting the user's email for Identity Center logins. If your CLI does not report it and the import still collapses the two users, please reopen with thekiro-cli whoamioutput shape (keys only, values redacted).fix(kiro): read the whoami identity when kiro-cli appends its Profile…