An IAM Identity Center organization can enable Kiro in both of its regions, us-east-1 and eu-central-1. Each region has its own profile, its own month of credits and its own overage cap. The plugin used only the first profile it found, so when that region was used up the account left rotation while the other region still had credits.
- Overage: with overageStatus ENABLED, the month counts against overageCap (the month's whole limit).
- Identity Center sign-ins list their profiles in both regions and keep them with the account (`profiles`, by region). A region with no profile is asked for again at most every PROBE_MS (10 minutes).
- A request goes to the first enabled region with credits left. On MONTHLY_REQUEST_COUNT / USAGE_LIMIT that region rests until its reset (an hour when none is known), and the request is sent once to the other region. A rate limit is passed on with Kiro's wait as Retry-After. When every region is used up, the reply is a 429 that names them, carries the last wait and names any region not enabled.
- auth.usage reads both regions. Each region gets a window, shown only, and their sum is the window magpie weighs the account by.
- Builder ID, Google, GitHub and API key sign-ins keep one region.
Run at head ce4004b99257fb66bac92a564a322b693748a7ec, merged onto main 978bb42b (mote, macOS, Bun 1.4.2, Node 22.22.0, HOME=$(mktemp -d)):
- bun test packages/kiro: 140 pass, 0 fail (main: 127 pass).
- bun scripts/check.mjs kiro and bun scripts/check.mjs: ok.
- Repo-wide bun test: 6675 pass, 0 fail (main: 6662 pass).
- Reviewer's Retry-After probe, social and Identity Center 429s: green, as on main.
- Broken by hand, each red in 1-2s: usedUpSaid always or never true, no spend on a used-up reply, overage off, pick ignoring spent regions, usage never spending, two regions for every sign-in, no PROBE_MS gate, no tried guard (red, no longer a hang), the wait dropped from the loop, the wait dropped from the all-used-up 429.
- Survives: a region not enabled that is never probed again after the first probe. No test covers the re-probe after PROBE_MS.
Not tried: a real Identity Center account running out in one region. The author ran real accounts enabled in one region each.