Repository navigation
Conversation
…onest no-profile message
Skripd
force-pushed
the
feat/kas-profile-selector
branch
from
November 3, 2026 22:30
68f996a to
8081f11
Compare
Contributor
|
Status check from a stale-PR sweep. Two things changed on main since this was opened:
What is left of value is the profile selector itself. Porting it means rebuilding it on main's |
This branch has not been deployed
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.
Problem / Motivation
Goal: When a Kiro sign-in resolves more than one profile, let the user choose which one their agents run as, show which profile is active afterwards, and tell a user with no entitled profile what actually happened.
Two gaps in the dashboard Kiro sign-in (Settings -> Agent Harness -> Kiro sign-in):
Why it matters
Users on multi-profile accounts had no way to pick their profile from the dashboard (kiro-cli already offers this), so agents could run as the wrong one with no indication which. And the misleading error in #28904 sent users debugging an approval that had actually worked; the real cause - no profile assigned - was never surfaced, so they could not act on it (the fix is an admin assignment, which the message now names).
Not a goal
What changed (motivation -> approach -> change)
auth/service.py): the IdC poll branches on the resolved profile count - 0 returnserror+code:"no_profiles"+ the probedregion; 1 auto-completes as before; >1 holds the authorized token in memory on the pending login and returns a new non-terminalselect_profilestatus carrying the choices.select_profile(login_id, arn)validates the ARN against the offered set (UnknownProfileErrorotherwise) and finishes through the existing persist step. A control-plane failure now carriescode:"profile_resolution_failed", distinct fromno_profiles. The chosen profile's human name is stored intoken.extraso the card can name it;status()exposesprofile_arn,profile_name, andprofile_region(derived from the ARN), all token-free.dashboard/handlers/kas_login.py, route inroutes/realtime.py,api/client/onboarding.ts,api/client.ts): newPOST /api/kas-login/select-profile;KasLoginPollResultgains theselect_profilestatus,profiles,region, and codes;KasLoginStatusgains the three optional profile fields; newKasLoginProfileChoicetype andkasLoginSelectProfile().components/KasLoginGate.tsx,pages/developer/KiroSignInCard.tsx,i18n/locales/en.manual.json): aProfileChooserstep (one radio per profile, name + region from the ARN, first preselected so a single confirm signs in) renders when the poll returnsselect_profile; the problem screen shows an amber "signed in, but no Kiro profile" message (not the red approval-failed one) forno_profiles, naming the region and the admin remedy; the signed-in summary showsProfile: <name> (<region>)when a profile is present.Backwards compatibility
Compatible: no existing wire field is removed, renamed, or made stricter.
KasLoginPollResult.statusgains a new member (select_profile) that only a multi-profile IdC sign-in produces; existing single-profile and error flows are unchanged. The three newKasLoginStatusprofile fields are OPTIONAL in the type, so a client reading an older gateway (which does not send them) still type-checks, and the UI guards on their presence.POST /api/kas-login/select-profileis a new route; nothing calls it on an old client.Removes nothing: no capability, record, key, or path is withdrawn or tightened; the change only adds a mid-sign-in state and three read-only status fields.
Tests
Backend (
test/test_kas_login_service.py):test_poll_oidc_multi_profile_offers_a_choice- profiles on different control planes are merged and offered;select_profilecompletes with the chosen ARN and stores its name.test_poll_oidc_dedupes_a_profile_seen_on_two_hosts- a profile reported by both hosts is offered once; a lone profile still auto-completes.test_select_profile_rejects_an_unoffered_arn,test_select_profile_on_unknown_login_raises- selection validation.test_poll_idc_with_no_profiles_is_error_and_saves_nothing/..._control_plane_failure_is_error- the two distinct error codes.test_status_reports_active_kiro_profile/test_status_profile_fields_blank_without_a_kiro_profile- the three status fields.Frontend:
KasLoginGate.test.tsx- chooser offers both profiles with regions, first preselected,select_profilecalled with the chosen ARN;no_profilesshows the honest message (and NOT the generic one); a non-profile terminal error keeps the generic message.KiroSignInCard.test.tsx- the active-profile line shows name + region when present, and is absent for a social sign-in.Proof: not provable -- fix PR proof (prove.py) applies to the discovery
fix:PR; this is afeat:PR whose tests assert new behavior that did not exist before, so a revert-the-production-hunk proof does not apply.Manual verification
Verified end to end against a live gateway built from this branch using a real IAM Identity Center account (region eu-west-1) that resolves two profiles (us-east-1 and eu-central-1 on the same account):
Profile: KiroProfile-eu-central-1 (eu-central-1).Screenshots / video
Related Issues
Closes #28904 #29139
Part of #29049 issue, if a new selector issue is opened
Sibling sweep
N/A - feat PR, not a fix/revert.
Pattern harvest
N/A - feat PR, not a fix/revert.