Repository navigation
fix(models): say why the picker is short when kiro-cli is signed out - #39183
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the change reads the existing [DESIGN-REVIEWED] d68109b Description read[DESCRIPTION-READ] 325f00f8d22dec1248ac4904bf7acf7de51d466c7544466aa14ecaf12d644672 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 |
UX Review (Opus 5.5) — ✅ PASSUX-level review of UX-Verdict: PASS Nothing blocks. The PR shows both states of the new button (run and copy) in the picker and in Settings, plus the confirm dialog. The blind reader identified each control and would dare to use it. Notes
[UX-REVIEWED] d68109b Description read[DESCRIPTION-READ] fb78e9c025cc72c9a743d3dd197f289fdda49ab66486490e754d9ea4e6f4b254 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Every item answers the reported defect (#39169) or the Goal; the only gaps are two small second spellings of helpers that already exist. Notes
What this change shipsInventory (8 items) — 6 justifiedIntent: when kiro-cli is signed out, the person sees why the model list is short and can sign kiro-cli in without typing a command. FIX.
[FIRST-PRINCIPLES-REVIEWED] d68109b Description read[DESCRIPTION-READ] 298442447f9a93417251d0b76f7da9860a0c8856c45f1189a0c6285c0eecc01e That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
ab61ed4 to
bb71558
Compare
|
span=b42dac35d2c8
|
|
span=89b9782d0d65
|
|
span=e9b5cd5bafd8
|
bb71558 to
bc36927
Compare
|
span=1b30fd4713eb
|
|
span=af68f7eb27d2
|
When kiro-cli's own login is missing or expired, GET /api/models answers 503 kiro_prerequisite_required and the chat model picker falls back to Default with no reason. Settings > Chat named the cause but told the user to run `kiro-cli login` in a terminal. Both composer pickers now show a one-line notice and a "Sign in to Kiro CLI" button, and the Settings > Chat banner carries the same button. The button runs the prerequisite status's login_command in the dashboard Terminal panel behind the usual Run in terminal confirm, so no one has to type a command. A harness's own list (models_backend) never shows the row. Closes #39169
bc36927 to
d68109b
Compare
|
span=1b30fd4713eb
|
Code change approver recommendation: A person should decideWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, but it changes 703 lines, more than the 400 it may approve on its own. This frontend-only PR shows a 'Kiro CLI isn't signed in' row with a Sign in to Kiro CLI button in both composer pickers and in the Settings ▸ Chat banner. The button reuses the existing Run in terminal confirm, or copies the command where no terminal here can run it. I checked each host against the receiver that answers it. Settings on /settings goes to the app-wide fallback receiver. The composer and split pane go to the chat page's receiver, which refuses unless the active chat runs here, and the PR gates on that. Members-page panes go to their own scoped receivers. Embed and popout windows (including /embed/settings) get the copy button, matching the shell's hasDock rule. Placement errors only ever cause an unneeded copy, and a refused run still shows the receiver's own notice. The command comes from the gateway's status and runs only after the existing confirm. The flag the row reads is set only for the configured list and is cleared when the list loads. Tests cover every host and both states, all 12 catalogs are updated, the spec doc is updated, and CI is green. Nothing blocks. Tier: 2, held for a person: security-sensitive path. An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Reviewed on head d68109b. I checked correctness against both composer pickers and the Settings banner, the root and website blocking rules, open PRs for duplicates, and main for an existing fix. I also checked the added tests for determinism and confirmed the screenshots match this head's strings. Nothing blocks.
Security: the sign-in button adds no new way to run a command. It goes through the existing Run in terminal confirm, which shows the exact command and the sensitive-command warning before anything runs. The receiving bridge still applies its own copy, cwd and runs-here refusals. The command comes from the gateway's prerequisite status (the redacted constant for non-owners), not from user or model input. A wrong run-or-copy guess falls back to copying and never runs on the wrong machine.
Done well: one hook (useKiroCliCanRunHere) decides run or copy for all three hosts, and the confirm is mounted outside the picker portal so it survives the picker closing.
Optional:
- No test renders ComposerDockView or runs the split pane's flag computation. Removing the
models_backend === undefinedguard or the remote-executor check would not fail any test. One host-level case for each would pin them. - The Backwards compatibility line says "Removes nothing", but the signed-out Settings banner no longer shows the fetch error. The comment in modelListHealth.ts and the sentence in acp-client.md still describe the old behaviour.
- KiroCliSignInInTerminal.tsx reads the prerequisite status and reuse_current with getQueryData, which does not subscribe. A subscribed useQuery, as RunInTerminalBtn does, would keep the confirm's Run or Copy wording current.
Problem / Motivation
Goal: When kiro-cli's own login is missing or expired, the model picker and Settings ▸ Chat say why the model list is short and offer an in-app way to sign kiro-cli in.
With kiro-cli signed out,
GET /api/modelsanswers503 kiro_prerequisite_required. The chat model picker then lists only Default and says nothing, so the list just looks broken. Settings ▸ Chat names the cause, but its only remedy is "Run 'kiro-cli login' in your terminal".Why it matters
Anyone on the Kiro CLI harness, or on KAS started through kiro-cli's own sign-in, can hit this after kiro-cli's login lapses. Nothing in the picker points to the cause. The one hint, in Settings, expects the user to open a terminal and type a command.
Not a goal
KiroCliSignInRow), which already has its own sign-in row.What changed (motivation → approach → change)
The frontend already records that
/api/modelsfailed withkiro_prerequisite_required(markModelsAuthRequired). Only the Settings banner read that flag, and neither composer picker did. kiro-cli has no sign-in the dashboard can drive, so the in-app path is the dashboard Terminal panel. Run in terminal already opens it, behind a confirm that shows the exact command.KiroCliSignInInTerminal.tsx: a hook that runs the prerequisite status'slogin_command(falling back tokiro-cli login) through the existing Run in terminal flow, a Sign in to Kiro CLI button, and the picker's notice row.ModelEffortDropdownfromComposerDockView, and the split-paneChatPanePickerMenus) show the notice while the configured list is held back. The button closes the picker first, and the confirm is mounted outside the picker so it survives that. A harness's own list (models_backend) never shows the row.useKiroCliCanRunHere, decides this for all three hosts. The split pane also needs the page's active chat to run here, because that chat owns the terminal receiver. In the copy state the Settings banner says to copy the command instead of naming a button that is not there, and the signed-out banner no longer repeats the fetch error under its lead.en-XAis regenerated.docs/system-specs/common/model-selection.mddescribes the row, andwebsite/capture/gets the capture page and harness used for the screenshots below.Backwards compatibility
Compatible: the new row and button appear only while
/api/modelsreportskiro_prerequisite_required. Every other picker and banner state renders as before.Removes nothing: the Settings banner keeps its Retry button, and only its text changes.
Tests
website/src/components/KiroCliSignInInTerminal.test.tsx: the button opens the confirm with the status's own command and dispatchesmc:run-in-terminalonly after Run. It falls back tokiro-cli loginwith no status and no query client.ModelEffortDropdownshows the row only when its caller passesonKiroCliSignIn.KiroCliSignInInTerminal.test.tsxalso checks that a host that cannot run shows only the copy button, and pinsuseKiroCliCanRunHerefor the main window, embed, popout, unread or remote placement, and a terminal turned off.website/src/components/ChatPane.pickerMenus.test.tsx: the split-pane picker shows the row on the signed-out flag, closes on the button, and its confirm stays open. A pane whose chat runs elsewhere gets the copy button. The row is absent otherwise.website/src/test/SettingsChatPanelCoverage.test.tsx: the signed-out banner no longer says "in your terminal" and its button opens the confirm. With the terminal off it shows the copy button and the copy wording. The generic degraded banner has no such button.ChatPane.pickerMenus.test.tsxalso covers a local pane while the page's active chat is remote or unread: copy, not Run.Proof: not provable -- frontend test (prove.py runs Python only)
By hand: with the four production files reset to
origin/main, the picker, dropdown and Settings cases fail (3 failed), and they pass on the head.Manual verification
Component renders with mocked data (below).
npx vitest run src/i18n/(1270 passed),npm run i18n:checkwithI18N_BASE_REFset, and the neighbouring chat and Settings suites (275 passed) are green.Real-machine verification
Not run. The change is frontend-only and reuses the existing Run in terminal flow. Unit tests and the component renders below cover the new row, the button and the confirm.
Screenshots / video
Component render, not the live page (mocked data, dark theme).
The confirm that Sign in to Kiro CLI opens:
Settings ▸ Chat ▸ Model banner, with a terminal, then without:
Related Issues
Closes #39169
Related: #39095, #15346, #18494, #35890
Sibling sweep
Swept: git grep -n "kiro-cli login" -- website/src/i18n/locales/en.json website/src/pages website/src/components
Sibling: website/src/pages/chat/KiroCliSignInRow.tsx -- not affected -- chat error card already shows the sign-in commands and Check again
Sibling: website/src/components/KiroPrerequisiteGate.tsx -- not affected -- first-run gate, owns its own sign-in screen
Pattern harvest
Not generalizable: one cause flag that only one of its three readers drew; the fix wires the other two.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)