Skip to content

feat(dashboard): say how to switch Kiro accounts in the Kiro Account modal - #17728

Closed
buluoray wants to merge 1 commit into
mainfrom
fix/kiro-account-switch-hint-4184
Closed

buluoray wants to merge 1 commit into
mainfrom
fix/kiro-account-switch-hint-4184

Conversation

@buluoray

@buluoray buluoray commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: A user with more than one Kiro subscription can see, from the Kiro Account modal, how to switch Kiro Crew to another account.

Users with both a personal and an enterprise Kiro subscription have no in-product hint about how to move Kiro Crew from one to the other (#4184, re-sighted as #13868). The reporter's own workaround is kiro-cli logout then kiro-cli login. They pointed at the signed-in-account area of the dashboard as the place to look. That area is the Kiro Account modal, and today it shows the account but says nothing about changing it.

Why it matters

Without the hint, a user has to guess whether switching accounts means restarting the gateway, editing files, or reinstalling. On main, kiro-cli logout + kiro-cli login already works end to end: KiroPrerequisiteService fingerprints the identity store, and _retire_sessions_on_identity_change in chat_runner.py recycles children started under the old account at their next turn. The capability exists but nobody can find it.

Not a goal

  • No named-account store, no switcher control, no per-session account pinning. That would make Kiro Crew hold and swap several Kiro credentials. kiro_prerequisite.py says Kiro Crew never authenticates on the user's behalf for the kiro-cli backend, and this PR does not reopen that.
  • No change to the KAS-mode sign-in card (Settings > Agent Harness), which already has its own sign-out and sign-in-again.
  • No change to identity detection or the session retirement sweep.

What changed (motivation → approach → change)

Gap: the account can already be switched, but the dashboard never says how. Approach: show the two kiro-cli commands in the one place the user looks for their account, with no new credential surface. Each command is taken verbatim from the gateway, so it is correct on every install shape. On the desktop app's bundled kiro-cli the bare name is not on the user's PATH, so the gateway serves its quoted absolute path, the same way the setup gate already does for login_command. Change:

  • src/kiro_crew/kiro_prerequisite_status.py: new KIRO_CLI_LOGOUT_COMMAND and logout_command_for(binary, environ). They are composed from the same (prefix, suffix) wrapper login_commands_for uses, now factored into _command_wrapper so the two cannot drift. PrerequisiteStatus carries logout_command, set in kiro_prerequisite_probe.py at all three sites that set login_command; src/kiro_crew/kiro_prerequisite.py lists the new names in its facade.
  • website/src/components/KiroAccountModal.tsx: below Manage account, a Switch Kiro account block with a visible heading. It has one sentence ("In a terminal, sign out of Kiro CLI, then sign in with your other account."), then logout_command, then both sign-in commands under the setup gate's own labels: personal (login_command) and organization SSO (sso_login_command), because a personal-to-enterprise switch needs the second one. All three are click-to-copy CopyCommand blocks, each kept on one line (whitespace-nowrap) so a long bundled path never wraps inside a flag. Right after it comes "Your chats stay. Your next message in each chat uses the new account.", before the commands, so "logout" does not read as risky. If the harness setting cannot be read, the block is replaced by an ErrorNotice with the agent hand-off (new key switch_account_config_unreadable). It shows only beside a reading, only to the owner (setup_allowed), only on the kiro-cli harness (isKiroBackend, the check the credit pill uses), and only when the status serves all three commands; it never falls back to a bare name. The status is read from the prerequisite gate's cached query through usePrerequisiteStatus() in hooks/useGatewayPlatform.ts, now exported, so no kiro-cli spawn is added. website/src/api/client/onboarding.ts types logout_command as optional.
  • Catalog keys switch_account_label, switch_account_steps, switch_account_effect and switch_account_config_unreadable in en.manual.json and all 11 translated catalogs, with en-XA.json regenerated. The commands are not in the catalog.
  • Docs: the feature-map Kiro credit balance row, and the prerequisite section of docs/system-specs/modules/learn-cron-dashboard.md (logout_command).

Backwards compatibility

Compatible: the status payload gains one field (logout_command), and logout_command is optional on the client, so an older gateway simply shows no switch steps.

Removes nothing: the diff adds a status field, a helper and a rendered block, and removes or tightens nothing. login_commands_for returns the same values it did; its wrapping moved into _command_wrapper unchanged, and its existing tests pass as they are.

Tests

test/test_kiro_prerequisite.py, test/test_kiro_prerequisite_handlers.py, test/test_kiro_prerequisite_probe.py:

  • test_logout_command_shares_the_login_prefix_on_a_bundled_install: on a bundled copy, logout is the quoted absolute path, with the same prefix as login.
  • test_windows_bundled_logout_command_names_powershell: on Windows it gets the same PowerShell wrapper as login.
  • test_off_path_override_logout_serves_its_absolute_path, test_system_resolution_keeps_the_bare_logout_command: these cover an off-PATH override and an ordinary PATH install.
  • test_update_cli_refuses_the_bundled_copy_without_spawning now also asserts the served logout_command on a real bundled probe. test_non_owner_dashboard_user_gets_only_redacted_readiness asserts the redacted branch serves no logout_command.

website/src/test/KiroAccountModal.test.tsx:

  • tells a signed-in user how to switch account with the gateway-served commands: with a bundled-path status, the block has a visible heading, its three code elements are exactly the served logout, personal login and SSO login commands in that order, and both tier labels are shown.
  • leaves the switch steps out when the gateway serves no logout command.
  • omits the switch-account steps for a non-owner, who gets only the bare stand-in commands (setup_allowed: false).
  • omits the switch-account steps on the claude / kas harness, where chats do not run on the kiro-cli account.
  • says why the switch steps are missing when the harness setting cannot be read: the notice shows, the reading stays, and the hand-off closes the modal.
  • omits the switch-account steps when there is no signed-in reading (api-key, signin-required, none, null).

Results:

  • After the rebase onto main: pytest -n0 on the three prerequisite test files: 158 passed. vitest run src/test/KiroAccountModal.test.tsx: 49 passed.
  • The bundled-probe test pins platform_compat.IS_WINDOWS to False, so its POSIX assertion holds on the Windows runner. Mutations: removing the wrapper from logout_command_for reddens the 4 non-bare logout tests. A bare-name fallback in the modal reddens the no-logout test. Dropping the reading guard reddens the 4 no-reading cases. Dropping the owner guard reddens the non-owner case. Dropping the harness guard reddens both non-Kiro cases. Dropping the config-failure notice reddens its case.
  • Also clean: tsc --noEmit, eslint on the touched files, black/isort/flake8/mypy on the touched Python files, and I18N_BASE_REF=origin/main node scripts/i18n-check.mjs (19 checks PASS).

Manual verification

Built the SPA and opened the modal through the shared serveDist + stubDashboardApi harness. The stubbed usage reading and /api/kiro-prerequisite covered a PATH install (light, dark, zh-CN) and a bundled macOS path (desktop and 390 px). The capture asserted that the dialog's code elements equal the served commands before each shot. The script was scratch-only and is not committed. Not run on this host: a real kiro-cli logout/login round trip, and the Windows PowerShell form, which is covered only by the unit test. The "moves them at the next message" sentence rests on the existing identity sweep in chat_runner.py and its tests, not on a fresh run.

Screenshots / video

PATH install, light:

Kiro Account modal, PATH install, light

Desktop app's bundled kiro-cli (absolute path served by the gateway):

Kiro Account modal, bundled kiro-cli

Dark, zh-CN, and 390 px phone width

Kiro Account modal, dark

Kiro Account modal, zh-CN

Kiro Account modal, bundled, 390 px

Related Issues

Refs #4184

Decision for the owner

#4184 asks whether Kiro Crew should store several Kiro credentials as named accounts, with an in-dashboard switcher and per-session pinning. This draft declines that store, because Kiro Crew deliberately never signs in to kiro-cli for the user and the logout/login identity sweep already switches every chat, and it ships only the missing in-product instruction (rejected alternative: a Crew-owned multi-credential vault, which would widen the credential trust boundary for a workflow that already works).

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

Contribution License Agreement

Contributions are accepted under the project's Apache-2.0 license.

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 7, 2026
@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 8ae6ca5955d2271013f6302baa4c8db35bca0be4 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Check that the prerequisite gate always fills its cached query before the modal opens; usePrerequisiteStatus uses enabled: false, so an empty cache hides the block silently.

[DESIGN-REVIEWED] 8ae6ca5

Description read

[DESCRIPTION-READ] 322597afa8505b9edc297988db69b5517ca53698fc14d5017b455ffcc266b0d7

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 8ae6ca5955d2271013f6302baa4c8db35bca0be4 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

First-Principles-Verdict: PASS

Check by hand that a real kiro-cli logout then login makes each existing chat's next message use the new account; the author says this round trip was never run.

What this change ships

Inventory (8 items) — 8 justified

Intent: a user with both a personal and an enterprise Kiro subscription can find out, from the Kiro Account modal, how to move Kiro Crew to the other account (#4184, #13868). This is an ADDITION: the capability already exists and nobody could find it.

  1. The Kiro Account modal shows a new Switch Kiro account section with a heading and one sentence of steps — justified
  2. The section shows the sign-out command as click-to-copy text — justified
  3. The section shows both sign-in commands, personal and organization SSO, under the setup gate's labels — justified
  4. A line says "Your chats stay. Your next message in each chat uses the new account." — justified
  5. The section appears only for the owner, only beside a reading, and only on the kiro-cli harness — justified
  6. If the harness setting can't be read, an error notice with the agent hand-off shows instead of the section — justified
  7. The owner's prerequisite status gains a logout_command field, with the same path wrapping as sign-in on bundled and off-PATH installs (one consumer: the modal) — justified
  8. usePrerequisiteStatus is now exported and the wrapper helper is factored into _command_wrapper (two consumers, no behaviour change) — justified

[FIRST-PRINCIPLES-REVIEWED] 8ae6ca5

Description read

[DESCRIPTION-READ] 0013cd8f91bdacfee8443efab905f142cfb86252934db03533c05c5b845f4aaa

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)

GPT 6.1 flagged blocking issues on 8ae6ca5955d2271013f6302baa4c8db35bca0be4; Opus 5.5 adjudication downgraded every one of them to advisory. Adjudication downgraded all 1 blocking finding(s) to advisory: the remedy each one requires is disproportionate to the harm it prevents. Read them as advice, not as merge conditions.

This comment is updated in place on each push.

Review details

BLOCKING -- website/src/components/KiroAccountModal.tsx:700 -- Cached settings suppress config-refetch failures
if (failedWithNoData(kirocrewCfgQuery)) {
A connection failure exhausting retries during a WebSocket-triggered config refetch → React Query retains cached settings → this condition stays false, so the modal renders commands without reporting the failed read.
Anchor: errors-use-error-notice
Fix: Include kirocrewCfgQuery.isError in the notice condition alongside failedWithNoData(kirocrewCfgQuery).

[BLOCK-MERGE-DOWNGRADED] 8ae6ca5
[GPT-REVIEWED] 8ae6ca5

Adjudication (Opus 5.5) — is blocking on each finding proportionate?

F1 (LOW): The failure needs two things at once: a successful earlier read cached under ['kirocrewConfig'] (website/src/components/KiroAccountModal.tsx:693-696), and then a refetch that fails. failedWithNoData returns false whenever data is defined (website/src/api/queryState.ts:9), so the modal shows commands from the last good read. Recovery: the default useQuery refetches when the modal is mounted again (KiroAccountModal.tsx:693), which clears the stale state. The finding cites the blocking rule errors-use-error-notice, but that rule only governs how an error is rendered (.review-base-rules/website-AUTOSDE.yaml:627). This site already renders through ErrorNotice with askAgent (KiroAccountModal.tsx:701-705), so the rule's flag does not apply.
The proposed fix keys the notice on isError, which the shared helper's contract rejects on purpose (queryState.ts:4-6). It would also hide valid cached steps on any brief network blip. That costs more than a stale, self-correcting display of commands that still run.

[ADJUDICATION] 8ae6ca5955d2271013f6302baa4c8db35bca0be4 total=1 uphold=0 downgrade=1
DOWNGRADE F1 website/src/components/KiroAccountModal.tsx:700 reason=disproportionate-remedy
[GPT-ADJUDICATED] 8ae6ca5955d2271013f6302baa4c8db35bca0be4

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 8ae6ca5955d2271013f6302baa4c8db35bca0be4: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 8ae6ca5955d2271013f6302baa4c8db35bca0be4 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 8ae6ca5

Verdict parsed from the review's SHA-scoped output markers for commit 8ae6ca5955d2271013f6302baa4c8db35bca0be4.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 8ae6ca5955d2271013f6302baa4c8db35bca0be4: <one-sentence reason>

@github-actions

github-actions Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — 🔴 BLOCK

UX-level review of 8ae6ca5955d2271013f6302baa4c8db35bca0be4 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: BLOCK

cannot evaluate: missing the config-unreadable notice, and the screenshots predate HEAD. They show wrapped commands and the reassurance line last; the code puts it before the commands and uses whitespace-nowrap.

Watch

  • The heading reads like a button. "Switch Kiro account" sits right under "Manage account". The blind reader "look[ed] for a button that isn't there" and asked "whether 'Manage account' would also let me switch." This happens on every visit, but it is only friction. Fix: make the heading a noun phrase such as "Using another Kiro account", or start the steps line with "To switch…".
  • Users can't tell which sign-in command is theirs. The tier labels say "Builder ID", "SSO" and "IAM Identity Center". The reader said "I couldn't tell which one is mine." Running the wrong login sends a switching user down the wrong flow. Fix: tie each label to the user's situation, for example "Work or organization account (SSO)".
  • zh-CN uses two words for "account". The new strings use 账号 while the modal title and "Manage account" use 账户. The reader asked "whether they're two different kinds of account." Fix: use 账户 in switch_account_label and switch_account_effect.

Evidence gaps

  • switch_account_config_unreadable notice: the ErrorNotice with the agent hand-off appears in no screenshot. Close it with a capture of the modal when the config read fails.
  • The shipped layout: shots 01–05 show the "Your chats stay…" line after the commands and the bundled path wrapping inside --use-device- / flow. HEAD renders that line before the commands and keeps each command on one line, scrolling sideways. Close it with fresh desktop and 390 px captures of the bundled path at HEAD, showing the horizontal scroll and that the copy glyph stays visible.

[UX-REVIEWED] 8ae6ca5

Description read

[DESCRIPTION-READ] cbc2fa738141dd503613f1f99556a8defd5f53a0a26c05138cc01c8ed4a8bbc2

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@buluoray
buluoray force-pushed the fix/kiro-account-switch-hint-4184 branch from be441b1 to d909e99 Compare October 7, 2026 12:24
@buluoray

buluoray commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions for the review round on be441b14f7. All of them are addressed in d909e996f6.

  • Opus (bare kiro-cli logout / kiro-cli login fails with command-not-found on the bundled kiro-cli): fixed. The gateway now serves logout_command, composed by logout_command_for with the same wrapper login_commands_for uses (factored into _command_wrapper). The modal renders the served logout_command and login_command verbatim in code. Neither is a catalog value any more, and when no logout_command is served the steps are left out rather than falling back to a bare name. Pinned by test_logout_command_shares_the_login_prefix_on_a_bundled_install, the Windows and off-PATH tests, and a real bundled probe assertion in test_update_cli_refuses_the_bundled_copy_without_spawning. Mutation: removing the wrapper from logout_command_for reddens all 4 non-bare cases.
  • UX (the commands read as plain words, no copy): fixed. Each command is now its own click-to-copy CopyCommand block, the same component the setup gate uses.
  • UX (does switching lose my chats?): fixed. The closing sentence now says "Your chats are kept. Kiro Crew moves them to the new account the next time you send a message."
  • Design (does "each chat's next message" hold beyond the dashboard chat path?): reworded. The sweep runs from the dashboard chat turn path (chat_runner.py) and retires every kiro-backed session it holds. The copy no longer promises anything per channel or per cron job: it says chats move at "the next time you send a message".
  • First Principles (a real logout/login round trip is untested): acknowledged, not run. The PR body says so under Manual verification. The claim rests on the existing identity sweep and its tests.

@buluoray
buluoray force-pushed the fix/kiro-account-switch-hint-4184 branch from d909e99 to b10261d Compare October 7, 2026 12:44
@buluoray

buluoray commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

Dispositions for the review round on d909e996f6. All of them are addressed in b10261d503.

  • GPT (blocking: POSIX-only logout_command assertion fails on Windows): fixed. test_update_cli_refuses_the_bundled_copy_without_spawning now pins platform_compat.IS_WINDOWS to False, as this file does elsewhere, because the served commands follow the host flag, not platform_name. The Windows form keeps its own test, test_windows_bundled_logout_command_names_powershell.
  • Design (only the personal login_command is shown, so a personal-to-enterprise switch is half-covered): fixed. The block now shows both served sign-in commands, login_command and sso_login_command, under the setup gate's own labels ("Personal account — Builder ID, Google, or GitHub" / "Organization SSO — IAM Identity Center"), so the two surfaces name the tiers the same way. I did not reuse SignInCommands itself, because it carries gate-only hints (the bundled-path note, the start-URL prompt, the method note) that would make the modal much longer. The test asserts all three code elements in order, plus both labels.
  • UX (no visible heading): fixed. "Switch Kiro account" is now a visible h3, and the section is aria-labelledby it.
  • UX ("logout" sounds broader than Kiro): fixed. The sentence now reads "In a terminal, sign out of Kiro CLI, then sign in with your other account."
  • UX ("moves" sounds like chats leave): fixed. The closing sentence now reads "Your chats stay. Your next message in each chat uses the new account."

@buluoray
buluoray force-pushed the fix/kiro-account-switch-hint-4184 branch from b10261d to b10ccb7 Compare October 7, 2026 13:04
@buluoray

buluoray commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

UX round on b10ccb7dd1 (CONCERNS, advisory). I'm answering in this comment rather than with a push, because a new head would restart every lane over three wording points.

  • Readers can't tell "Builder ID" from "SSO / IAM Identity Center": declined for this PR. These are the setup gate's own labels (components.kiroPrerequisiteGate.sign_in_personal_label / sign_in_sso_label), reused on purpose so the two surfaces name the tiers the same way (this was the Design round's ask). The person this block is for has already signed in once through that gate with one of the two lines, so these words are not new to them. Rewording the tier labels means changing them on both surfaces together, and that is a separate, small follow-up if the owner wants it.
  • The copy affordance is only an icon: declined, out of scope. CopyCommand is the shared click-to-copy block used across first-run setup and Settings > Agent Harness, unchanged here. A "Click to copy" cue belongs in that component for every caller, not in this modal alone.
  • Wrapped bundled paths look like they contain spaces: noted, not changed. The block copies the exact command from the DOM (textContent), so the wrap never reaches the clipboard. Wrapping is the shared component's behaviour on narrow widths.

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 7, 2026
@iamwhatever
iamwhatever force-pushed the fix/kiro-account-switch-hint-4184 branch from b10ccb7 to 98db74a Compare October 19, 2026 21:44
@iamwhatever

Copy link
Copy Markdown
Contributor

Rebased onto main (ed975d7c8) as one commit, 98db74afc. Main split kiro_prerequisite.py, so the logout helper now lives in kiro_prerequisite_status.py and the three status sites in kiro_prerequisite_probe.py. The modal reads the existing usePrerequisiteStatus() (now exported) instead of a new hook.

  • Opus (non-owner sees the bare stand-in commands): fixed in 98db74a.

SwitchAccountSteps now returns null unless status.setup_allowed === true, so the redacted non-owner payload shows no switch steps.
Pinned by omits the switch-account steps for a non-owner, who gets only the bare stand-in commands; dropping the guard reddens it.
self-added: no
mechanism: owner guard on the switch-account block

@iamwhatever
iamwhatever marked this pull request as ready for review October 19, 2026 21:45
@iamwhatever
iamwhatever requested review from a team and KiroCrewCaptain as code owners October 19, 2026 21:45
@iamwhatever
iamwhatever force-pushed the fix/kiro-account-switch-hint-4184 branch from 98db74a to 2b2af43 Compare October 19, 2026 21:56
@iamwhatever

iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
  • span=ae088c629066 Harness identity inferred from a reading

fixed in 2b2af43: SwitchAccountSteps returns null unless isKiroBackend(kirocrewCfg) is true, the same positive check kiroUsageReadout.tsx uses.
Pinned by omits the switch-account steps on the claude / kas harness; dropping the guard reddens both cases.

@iamwhatever

iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
  • span=293c9bf95a25 Non-owner logout_command has zero readers

fixed in 2b2af43: the line is deleted. The redacted non-owner branch no longer serves logout_command; test_non_owner_dashboard_user_gets_only_redacted_readiness now asserts it is absent.
The client field is optional, and the modal is owner-only, so nothing reads it there.

@iamwhatever

iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
  • span=81cf83b7bb70 Wrapped commands split inside a flag (cause)

fixed in 2b2af43: each served command's code is now whitespace-nowrap, so it stays on one line and scrolls inside CopyCommand's existing overflow-x-auto span; a wrap can no longer fall inside --use-device-flow.
Copy reads textContent, so the clipboard text was always one line; now the screen matches it.

@iamwhatever

iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
  • span=3430b669c740 Wrapped commands split inside a flag (reader quote)

fixed in 2b2af43: each served command's code is now whitespace-nowrap, so it stays on one line and scrolls inside CopyCommand's existing overflow-x-auto span; a wrap can no longer fall inside --use-device-flow.
Copy reads textContent, so the clipboard text was always one line; now the screen matches it.

@iamwhatever

iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
  • span=5846dba6881c Wrapped commands split inside a flag (effect)

fixed in 2b2af43: each served command's code is now whitespace-nowrap, so it stays on one line and scrolls inside CopyCommand's existing overflow-x-auto span; a wrap can no longer fall inside --use-device-flow.
Copy reads textContent, so the clipboard text was always one line; now the screen matches it.

@iamwhatever

iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
  • span=0347a6fab3ec Wrapped commands split inside a flag (severity)

fixed in 2b2af43: each served command's code is now whitespace-nowrap, so it stays on one line and scrolls inside CopyCommand's existing overflow-x-auto span; a wrap can no longer fall inside --use-device-flow.
Copy reads textContent, so the clipboard text was always one line; now the screen matches it.

@iamwhatever

iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
  • span=b762cbaf3d56 Wrapped commands split inside a flag (fix)

fixed in 2b2af43, as suggested: whitespace-nowrap on each code, horizontal scroll in the existing overflow-x-auto span.

@iamwhatever

iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
  • span=3ecd809b0032 Sign-in tier labels

rebutted: these are the setup gate's own labels (sign_in_personal_label / sign_in_sso_label), reused on purpose so both surfaces name the tiers the same way (an earlier Design round asked for that).
Renaming them belongs to both surfaces at once, which is outside this PR's goal.

@iamwhatever

iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
  • span=c91ece294aca Dark-theme command boxes low contrast

rebutted: the box style is CopyCommand's shared bg-bg-elevated, unchanged here and used by first-run setup and Settings > Agent Harness.
A contrast change belongs in that shared component for every caller, not in this modal alone.

@iamwhatever

iamwhatever commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor
  • span=4709812b11d6 Steps sentence wording

rebutted: the heading names the task and the three code lines sit directly under the sentence; the copy matches the earlier UX round's wording ask.
Rewording means re-translating 11 catalogs for an advisory suggestion; left as is.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 19, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a maintainer design call before merge. The code itself looks correct and small.

Head reviewed: 2b2af43. Bots read: Design PASS, First Principles PASS, UX CONCERNS, Opus no blocking findings, GPT changes requested (blocking). Readiness was still running at review time.

What I checked:

  • _command_wrapper keeps login_commands_for output the same. logout_command_for uses the same prefix and suffix, so bundled, off-PATH and PATH installs get a matching sign-out command.
  • logout_command is set at all three probe sites that set login_command. The redacted non-owner payload does not serve it.
  • The modal block is positive-gated on the kiro-cli harness, the owner flag, a reading, and all three served commands. It never falls back to a bare name. Each guard has a test that reads as a real negative case.
  • The branch merges cleanly with current main. The merge conflict label looks stale for this head.

Why this needs a maintainer:

  • The PR refers to an issue that has the T3 tier. The PR declines the multi-account store that the issue asks for and ships only an in-product hint. That scope choice is a design decision, so it needs a design sign-off from a maintainer. I do not approve it as a reviewer.
  • The GPT lane blocks this head on errors-use-error-notice (see the inline comment). Either the small fix below or a maintainer decision on that lane is needed before readiness can pass.

Overlap: an open PR, #17784, also changes KiroAccountModal.tsx and its test file. The two changes look independent. The PR that merges second will need a rebase.

🔴 0 must-fix. 🟡 1 should-fix.

// on kiro-cli: the identity sweep recycles kiro-backed children only. Another
// harness can still hold a reading, so the harness is checked POSITIVELY, the
// same way the credit pill does (`kiroUsageReadout.tsx`).
const { data: kirocrewCfg } = useQuery<AcpBackendConfig>({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 A failed backend config read hides the switch steps with no notice, and the GPT lane blocks on it

If the backend config read (api.kirocrewConfig()) fails, kirocrewCfg stays undefined. Then isKiroBackend(undefined) is false and the whole block returns null. The user gets no switch steps and no sign that a read failed. Every other read in this modal goes through ErrorNotice (for example the forecast read in CreditUsage).

const { data: kirocrewCfg } = useQuery<AcpBackendConfig>({
  queryKey: ['kirocrewConfig'],
  queryFn: () => api.kirocrewConfig(),
})
if (!isKiroBackend(kirocrewCfg)) return null

Why it matters: the actual harm is small because the block is an optional hint. But the GPT lane maps this to the blocking errors-use-error-notice rule on this head, so readiness cannot pass until the code changes or a maintainer decides on that lane.

Suggestion: read error from the query. Before the harness check, render <ErrorNotice message={...} askAgent onHandoff={...} /> when the read failed, as the forecast read does. Add one test with a rejected kirocrewConfig query. If a maintainer decides that an optional hint may stay silent, I will withdraw this.
Rule: website/AUTOSDE.yaml errors-use-error-notice

@iamwhatever
iamwhatever force-pushed the fix/kiro-account-switch-hint-4184 branch from 2b2af43 to 6f407ec Compare October 19, 2026 22:09
@iamwhatever

Copy link
Copy Markdown
Contributor
  • span=6495811d8d25 Backend lookup failures silently hide the switch instructions

fixed in 6f407ec: when the kirocrewConfig read failed with no data (failedWithNoData), the block is replaced by an ErrorNotice with askAgent and the modal's onClose hand-off, new key switch_account_config_unreadable in all 12 catalogs.
Pinned by says why the switch steps are missing when the harness setting cannot be read; removing the notice reddens it.

@iamwhatever

Copy link
Copy Markdown
Contributor
  • span=a65365d0cb4a Screenshots predate the one-line commands

accepted gap: the screenshots in the body were taken before whitespace-nowrap; the change is one class on each code, inside CopyCommand's existing overflow-x-auto span.
No GUI capture was run on this host for the new head; a maintainer may want fresh bundled-path shots before merge.

@iamwhatever

Copy link
Copy Markdown
Contributor
  • span=805b36211d8f "logout" reads as risky before the reassurance

fixed in 6f407ec: "Your chats stay. Your next message in each chat uses the new account." now sits right under the steps sentence, before the three commands.

@iamwhatever

Copy link
Copy Markdown
Contributor
  • span=1fe7e3745c16 Mute the shared path prefix as on the gate

rebutted: the muted prefix lives in the gate's SignInCommands, with gate-only hints (bundled-path note, start-URL prompt) that would make the modal much longer; an earlier round declined reusing it for that reason.
With one-line commands the differing tail (logout / login) is at the line end; advisory, left as is.

@iamwhatever

Copy link
Copy Markdown
Contributor
  • Real kiro-cli logout/login round trip not run

needs-a-decision: this host has no second Kiro account, so no real switch was run. The copy rests on _retire_sessions_on_identity_change and its tests.
@maintainers: please run one real kiro-cli logout / login switch before merge, or accept the tested sweep as the evidence.

@iamwhatever

Copy link
Copy Markdown
Contributor
  • Real kiro-cli logout/login round trip not run

needs-a-decision: this host has no second Kiro account, so no real switch was run. The copy rests on _retire_sessions_on_identity_change and its tests.
@maintainers: please run one real kiro-cli logout / login switch before merge, or accept the tested sweep as the evidence.

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Oct 19, 2026
… modal

The Kiro Account modal now shows a Switch Kiro account block: the
gateway-served kiro-cli logout command and both sign-in commands
(personal and organization SSO), as click-to-copy code. The gateway
serves logout_command composed with the same wrapper as the sign-in
commands, so a bundled or off-PATH kiro-cli gets its absolute path.
The block shows only beside a reading, only to the owner, and only on
the kiro-cli harness.

Refs #4184
@iamwhatever

Copy link
Copy Markdown
Contributor
  • Absence tests pass before the harness read lands

fixed in 8ae6ca5: the no-logout and non-owner tests now wait for the kirocrewConfig query data before asserting absence.
Mutation: dropping the owner guard and the logout guard now reddens both tests.

@iamwhatever

Copy link
Copy Markdown
Contributor
  • cannot evaluate: missing the shipped layout

needs-a-decision: the body's screenshots predate the one-line commands and the moved reassurance line. This host could not build and capture the SPA.
@maintainers: please attach fresh Kiro Account modal shots (bundled path, light and 390 px) for the current head, or override the UX lane.

@iamwhatever
iamwhatever force-pushed the fix/kiro-account-switch-hint-4184 branch from 6f407ec to 8ae6ca5 Compare October 19, 2026 22:21
@iamwhatever

Copy link
Copy Markdown
Contributor
  • Empty prerequisite cache hides the block

rebutted: KiroPrerequisiteGate wraps the whole dashboard and owns the ['kiro-prerequisite'] query, so it is filled before any page (and this modal) mounts; see the useGatewayPlatform doc comment.
With no cache (older gateway, provider-less tree) the block is left out on purpose rather than guessing commands.

@iamwhatever

Copy link
Copy Markdown
Contributor
  • Real kiro-cli logout/login round trip not run

needs-a-decision: no second Kiro account on this host. The copy rests on _retire_sessions_on_identity_change and its tests.
@maintainers: run one real switch before merge, or accept the tested sweep.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 19, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Follow-up on the new head 8ae6ca5. The should-fix from my last review is fixed. This still needs a maintainer design call before merge.

What changed since 2b2af43 (I read the incremental diff of KiroAccountModal.tsx and its test; the rest of the range is the rebase onto main):

  • A failed harness config read now renders ErrorNotice with the agent hand-off instead of silently dropping the block. It uses the shared failedWithNoData helper, and it sits after the owner check, so a non-owner still sees nothing.
  • The new key switch_account_config_unreadable is present in the locale catalogs I spot-checked (en, en-XA, zh-CN, ja).
  • A new test rejects the config read and checks the notice, the absent steps, the still-rendered account reading, and the hand-off closing the modal.
  • The two absence tests now wait for the config query before asserting, so they fail for the right reason.
  • The reassurance line now sits above the commands.
  • The GPT lane is green on this head.

What still needs a maintainer:

  • The PR refers to an issue with the T3 tier and declines the multi-account store that the issue asks for, shipping only an in-product hint. That scope choice needs a design sign-off from a maintainer. I do not approve it as a reviewer.
  • The UX lane could not evaluate this head because the body screenshots predate the one-line commands and the moved line. Fresh shots of the modal, or a maintainer decision on that lane, are needed.
  • The author asks a maintainer to run one real sign-out and sign-in switch, or to accept the tested session sweep as evidence.
  • Some backend test shards were still running when I read the checks.

Overlap: #17784 also changes KiroAccountModal.tsx and its test file. The changes look independent; whichever merges second will need a rebase.

🔴 0 must-fix. 🟡 0 should-fix.

@buluoray

Copy link
Copy Markdown
Contributor Author

🤖 Kiro Crew Auto-Pipeline [operator: buluoray#ce473fca]: closing this PR. The operator is pausing work on T3/T4 issues for now, so this stays unmerged. The branch is kept: reopen the PR or reuse the branch if the issue is picked up again.

@buluoray buluoray closed this Oct 25, 2026
@github-actions github-actions Bot removed the readiness: action required A blocking check or review needs attention label Oct 25, 2026
@bolichen97
bolichen97 deleted the fix/kiro-account-switch-hint-4184 branch November 6, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants