Repository navigation
Description
Client or integration
OpenCodex dashboard
Area
Authentication and account pool
Summary
When adding a second Kiro account through the OpenCodex dashboard, the login succeeds and both Kiro accounts briefly appear.
However, after a few seconds, the newly added account disappears and only the original Kiro account remains.
I later verified the persisted state separately: ocx account list kiro --quota shows only the original account, and ~/.opencodex/auth.json also contains only that account, so this does not appear to be only a dashboard display issue.
I expected both Kiro accounts to remain in the account pool, since they have different profileArn values.
This is reproducible on OpenCodex 2.52.0.
Reproduction
-
Open the OpenCodex dashboard.
-
Make sure one Kiro account/provider is already configured and working.
-
Add another Kiro account/provider through the dashboard.
-
The second account is added successfully and may briefly appear alongside the first one.
-
After a short time, the newly added account disappears, and only the original Kiro account remains.
-
Repeating the process produces the same behavior: adding another Kiro account effectively replaces or gets overwritten by the existing account instead of keeping both accounts in the account pool.
I later verified the persisted state separately and found that ~/.opencodex/auth.json also ends up containing only one Kiro account, so this does not appear to be only a dashboard display issue.
Version
2.52.0
Operating system
macOS 27.0 (Apple Silicon, M5 MacBook Pro)
Provider and model
Kiro — multi-account authentication/account pool (model not applicable)
Logs or error output
OAuth refresh started provider=kiro
OAuth credentials rotated and persisted provider=kiro
These messages were observed during later troubleshooting around the time the second Kiro account disappeared. The original issue was reproduced through the OpenCodex dashboard without any CLI commands.
Error: A login for kiro is already in progress
This error occurred during an earlier Kiro login attempt and may or may not be related.Screenshots and supporting files
No response
Redacted configuration
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
lidge-jun commentedon Sep 12, 2026
리뷰 · 우선순위 64 / 80
설명
이 이슈는 OpenCodex 대시보드에서 Kiro 계정을 두 번째로 추가하면, 로그인은 성공한 것처럼 보이고 잠깐 두 계정이 함께 보이는데, 몇 초 뒤에 새로 추가한 쪽만 사라지고 원래 Kiro 계정만 남는다는 버그다. 보고자는 화면만의 깜빡임이 아니라고 따로 확인했다.
ocx account list kiro --quota와~/.opencodex/auth.json둘 다 결국 계정 하나만 남는다. 기대는 서로 다른profileArn이면 account pool에 둘 다 남는 것이다. 재현 환경은 OpenCodex2.52.0, macOS Apple Silicon이다.지금
devHEAD(dcd13b435, package2.53.0) 기준으로 Kiro는 “한 슬롯만 되는 프로바이더”가 아니다.src/oauth/store.ts의SINGLE_SLOT_PROVIDERS에는chatgpt만 들어 있고, Kiro는 multi-account 경로를 탄다. 대시보드에서 “계정 추가”는src/server/management/oauth-account-routes.ts가addAccount: true(또는 reauth)일 때forceLogin: true를 넘긴다. 그러면src/oauth/index.ts의runLogin이saveCredential(..., { preserveIdentityless: true })로 저장하고,src/oauth/kiro.ts의loginKiro({ forceLogin: true })는 kiro-cli를 logout→login으로 한 번 갈아 끼운 뒤 새 세션을 import한다. 주석도 “Account-add login deliberately asks kiro-cli to switch identities”라고 적혀 있다. 즉 설계 의도상 두 번째 Kiro 계정은 붙어야 한다.슬롯을 구분하는 열쇠는
saveCredential이 쓰는 신원(accountId ?? email)이다. Kiro import 경로(oauthCredentialFromImported)는 SQLite/whoami에서 잡은profileArn을accountId로 넣고, 이메일이 있으면email도 넣는다. Builder ID용 고정 ARN(src/adapters/kiro-constants.ts의KIRO_BUILDER_ID_SERVICE_PROFILE_ARN)은 요청에만 쓰고, 계정 신원·KiroOAuthMetadata에는 넣지 말라고 코드가 못 박아 두었다. 그래서 보고자가 말한 “서로 다른 profileArn이면 둘 다 남아야 한다”는 현재dev모델과 같다. 그런데도auth.json에 하나뿐이면, UI 버그가 아니라 저장·신원 매칭·강제 로그인 정산·리프레시 중 어딘가에서 새 슬롯이 덮이거나 롤백되는 쪽을 먼저 봐야 한다.이슈에 적힌 로그도 그 축과 맞는다.
OAuth refresh started provider=kiro/OAuth credentials rotated and persisted provider=kiro는src/oauth/index.tsrefreshGenericAccountWithLock이 해당accountId슬롯만mergeAccountCredential로 갱신할 때 찍힌다. 정상 경로라면 다른 슬롯을 지우면 안 된다. 반대로A login for kiro is already in progress는 같은 파일의kiroLoginSettling가드다. 강제 로그인 직후·정산 중에 또 로그인을 겹치면 이런 메시지가 난다. 또한 Kiro CLI 쪽 세션은 기기당 사실상 하나라, add-account가 CLI를 새 신원으로 바꾼 뒤 예전 슬롯 리프레시가 400을 맞고matchingRotatedKiroCliCredential로 CLI의 새 토큰을 잘못 붙잡는 경우도 이론상 있다(신원profileArn/accountId가 일치할 때만 허용).2.52.0→ 현재dev2.53.0사이에 이 증상을 정면으로 고친 Kiro multi-account 커밋은 보이지 않으므로, 현재 HEAD에서도 열린 버그로 취급하는 편이 맞다. 지금dev핫 열차(Muse OAuth, Devin effort/WS, quota-avoid, credits 문서)와 파일은 겹치지만, account-pool 라벨 실사용 버그라 우선순위는 중상이다.경로
src/server/management/oauth-account-routes.tsaddAccount/reauth →forceLogin- 대시보드 “두 번째 계정 추가”가 실제로 강제 로그인 분기를 타는지부터 재현 로그로 확인해야 한다.forceLogin없이 import-only로 들어가면 CLI에 남은 세션만 다시 읽어 활성 슬롯을 갱신하는 쪽으로 기울 수 있다.경로
src/oauth/kiro.tsloginKiro/oauthCredentialFromImported/bindMatchingLegacyIdentitylessKiroAccounts- 새 슬롯의accountId(profileArn)와email이 첫 슬롯과 겹치면saveCredential이 append가 아니라 같은 신원 upsert가 된다. whoami 레이스(세션 토큰 불일치 시 identity 비움)와 legacy identity-less 바인딩이 재현에 끼는지 봐야 한다.경로
src/oauth/store.tssaveCredential/mergeAccountCredential/mutateStore- 신원 있는 append vs 신원 없는 active 교체 vs 세대 안전 merge.auth.json에 계정이 하나뿐이면 UI가 아니라 이 계층의 최종 persist 결과를 증거로 삼아야 한다.경로
src/oauth/index.tsrunLogin+rollbackForcedKiroAccountWrite+settleKiroLoginTransaction+kiroLoginSettling- 강제 로그인 실패 시에만 새 슬롯을 걷어 내고, 성공 시 CLI recovery를 버린다. “잠깐 두 개 → 곧 하나”가 낙관적 UI 후 실패 롤백인지, 성공 persist 후 다른 쓰기인지 타임라인으로 가른다.경로
src/oauth/kiro.tsrefreshKiroToken/matchingRotatedKiroCliCredential- add 직후 CLI는 새 계정인데 예전 슬롯 리프레시가 CLI 회전 토큰을 흡수하면, 증상은 “새 계정이 사라짐”보다 “두 슬롯이 같은 토큰/신원으로 수렴”에 가깝다.auth.json스냅샷으로 구분한다.경로
src/adapters/kiro-constants.tsKIRO_BUILDER_ID_SERVICE_PROFILE_ARN- 이 값은 계정 신원에 쓰면 안 된다. Builder ID 두 계정이 잘못 같은accountId로 저장되는지 점검 포인트다(보고자는 profileArn이 다르다고 했으므로 IdC 계정 쪽 가능성이 더 큼).메인테이너의 판단이 필요한 지점
auth.json의accounts[].credential.accountId·email·kiro.profileArn쌍을 받을지.auth.jsonmtime·내용).너의 추천
열린 버그로 두고
bug/account-pool을 유지한다. 작성자에게 비밀 가린 add 직후·사라짐 직후auth.json의 kiroaccounts배열(토큰 값은 길이만)과, 대시보드가addAccount: true로 호출했는지,forceLogin구간 전후 로그 순서를 요청한다. 재현이 “서로 다른 profileArn인데도 같은accountId/email로 upsert”이면saveCredential신원 규칙을 고치고, “디스크에 두 줄이 생겼다가 롤백/다른 persist로 사라짐”이면runLogin정산·동시 로그인·리프레시 쪽을 본다. types/config 분할에 잡아먹힐 PR이 아니므로 닫지 말고, 현재 Muse/Devin/quota 기차에는 끼우지 말고 재현 확인 후 짧은 독립 수정으로 받는 편이 안전하다.2.52.0사용자에게는dev/2.53.0에서도 동일 계열로 보인다고 안내하면 된다.이 댓글은 grok-bot이 작성했습니다
Merge pull request #4482 from lidge-jun/codex/260913-carry-4435
lidge-jun commentedon Sep 13, 2026
Fixed on dev via #4482 (merge commit 990cd8c).
The second account was not being lost on login. A leftover CLI profile ARN collapsed it onto the first account, which is why it appeared to vanish shortly after a successful sign-in.
Cross-platform CI run 34745142783 concluded success on the exact merged head. Closing manually because this merges into dev rather than the default branch.
fix(kiro): stop leftover CLI profile ARN from collapsing a second acc…
fix(kiro): stop leftover CLI profile ARN from collapsing a second acc…
Merge pull request lidge-jun#4482 from lidge-jun/codex/260913-carry-4435