Repository navigation
fix(kas): list models on the relay signed in only through Kiro Crew - #35890
Conversation
On the KAS harness a user signed in through Kiro Crew's own sign-in, with kiro-cli signed out, got an empty model picker: /api/models asked kiro-cli for its catalog and answered 503 kiro_prerequisite_required, although the relay spawn enters through kiro-cli-chat and draws its credential from Crew's vault. When kiro-cli's gate refuses and the next KAS spawn starts on Crew's usable sign-in alone, the picker serves the KAS engine's recorded model list for that account (auto alone until the first chat), the answer the bundle route already gives. Nothing is spawned for it. A passing gate, the launcher relay and every other harness keep the kiro-cli path and its kiro-cli login remedy. Part of #27049.
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. Each item answers the defect reported on #27049, and the fix is in the predicate that decides which sign-in counts, not at the 503 call site. What this change shipsInventory (6 items) — 6 justifiedIntent: let a KAS user who is signed in only through Kiro Crew pick a chat model without running
[FIRST-PRINCIPLES-REVIEWED] 0f40ae4 Description read[DESCRIPTION-READ] 149051e0527866faabfb6b36885228b4cb71f9030f959c90f6ebb41b77b7f0f4 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS No design-level concerns: the fallback runs only after kiro-cli's gate has refused, only for Notes
[DESIGN-REVIEWED] 0f40ae4 Description read[DESCRIPTION-READ] c39884c56669e502793b11229a7327d7dd1191aaa24d6605b43d10ad0e9fa532 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 |
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: |
Code change approver recommendation: A person should decideWhy: the decider thinks the change is probably fine but estimates a 15% chance that this change introduces a defect, above the 12% limit for approving on its own. Narrow, correct fix. The fallback runs only for the KAS backend and only after kiro-cli's sign-in check has refused. The new crew_sign_in_starts_spawn check matches how resolve_spawn chooses kiro-cli-chat versus the launcher: it requires a usable Kiro Crew sign-in and answers no on any failure, so nothing fails open. It reuses the bundle route's account-scoped reader for the recorded list and starts no spawn. Tests cover each branch, and the specs are updated in the same change. No regression found on other paths. 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 |
buluoray
left a comment
There was a problem hiding this comment.
Approve on 0f40ae4. On KAS's relay entered through kiro-cli-chat, a person signed in only through Kiro Crew now gets the engine's recorded model list for their own account (or auto until the first chat) instead of a 503 that told them to sign in to kiro-cli. The fallback runs only after kiro-cli's own gate has refused, only for the KAS backend, and only when Kiro Crew's sign-in is usable; a person signed in through kiro-cli keeps the same list, and a person signed in through neither keeps the same refusal. The new path reads no credential value and starts no process. Tests cover each branch, and four of the five guards turn a test red when broken. One follow-up: no test covers the backend == "kas" guard. Decisive lines: src/kiro_crew/dashboard/handlers/agents.py:1463, src/kiro_crew/dashboard/handlers/models_kas_bundle.py:153-166, src/kiro_crew/acp/kas_route.py:307-334
Problem / Motivation
Goal: on KAS signed in only through Kiro Crew, with kiro-cli signed out, the chat model picker lists the account's models instead of refusing with
kiro_prerequisite_required.On the default KAS setup, a user signed in with
kirocrew kas login(or the dashboard's Sign in) but not withkiro-cli logincan chat, yet the model picker stays empty:GET /api/modelsanswers 503kiro_prerequisite_requiredand tells them to sign in to kiro-cli. The relay spawn on that host enters throughkiro-cli-chatand draws its credential from Kiro Crew's vault, so kiro-cli's own sign-in is not what the turn runs on.Why it matters
Every KAS user who signed in only through Kiro Crew has no model choice, and is pushed toward a
kiro-cli loginthe turn does not need. On a remote host that browser login can fail outright (reported on #27049). The recorded decisiondocs/decisions/2026-10-30-choosing-kas-runs-kiro-crews-own-engine-when-kiro-cli-cannot.mdsays every KAS prompt points to the Kiro sign-in, not tokiro-cli login.Not a goal
/v1/chat/completionson the relay: a follow-up for Settings shows Kiro not ready on KAS when only Kiro Crew's own sign-in exists #27049 once fix(readiness): accept Crew's sign-in for turn gates on the KAS bundle route #25562 (the same readiness check for the KAS engine-bundle route) merges.KIROCREW_KIRO_BIN, or a kiro-cli with nokiro-cli-chatbeside it): it needs kiro-cli's own sign-in, so it keeps today's 503 and itskiro-cli loginremedy.What changed (motivation → approach → change)
The picker asked kiro-cli for its catalog on every KAS relay, so a signed-out kiro-cli decided the list for a spawn that never uses its sign-in. The right list already exists. Every KAS session records the engine's own model list for the account the vault names, and the bundle route serves it today.
/api/modelsbeforekiro-cli-chat, Kiro Crew sign-in, kiro-cli gate refuseskiro_prerequisite_requiredautoalone until the first chat--list-modelscrew_sign_in_starts_spawn()inacp/kas_route.py, which the dashboard reaches throughagent_sdk/kas_bundle.py, asks one question: does the next KAS spawn start on Kiro Crew's usable sign-in alone? That means the relay entered throughkiro-cli-chat, or the bundle route.vault_holds_identity, which the usage poll asks. That one names whose credential a spawn uses; this one asks whether Kiro Crew's own usable sign-in alone starts the spawn.api_modelsasks it only where kiro-cli's gate has already refused, and only forbackend == "kas". A passing gate keeps the kiro-cli catalog as before, warm-up included.models_kas_bundle.api_models_kas_crew_relaythrough the bundle route's vault-fenced recording reader. No cold probe and no--list-modelsread start for it; only the gate's existing sign-in check runs.model-selection.md,acp-client.md,harness-parity.mdand the docstrings ofagent_sdk/kas_model_catalog.pyandmodels_kas_bundle.pyname the relay case.Merge order with #25562: none needed. It states that a Kiro Crew sign-in never authorizes a
kiro-clispawn, and this PR starts no spawn of its own. Itstest_api_models_off_the_bundle_route_never_consults_the_crew_signinpasses either way, because a test home holds no vault sign-in.Backwards compatibility
Compatible: the only answer that changes is the first row of the table, from a 503 to a 200. A passing kiro-cli gate and every other harness take the same path as before. On that relay a gate refusal of either kind, signed out or a timed-out check, answers the recording, or
autowhile cold, instead of the 503.Removes nothing: no key, field, route or error code is removed; the 503 still answers every other host.
Tests
test/test_api_models_kas_bundle.py::TestTheCrewSignInRelay:--list-modelsspawn and no cold probe;autoand spawns nothing;test/test_kas_route.py::TestCrewSignInStartsSpawn: thekiro-cli-chatrelay and the bundle route start on Kiro Crew's sign-in alone; the launcher relay and a lapsed sign-in do not.Determinism: the three changed classes passed 20 runs at
-n0and 10 at-n 4 --dist loadgroupbesidetest_api_models_retry.pyandtest_kas_model_catalog.py; both changed files passed in a shuffled order (seed 21571).Proof: PROVEN test/test_api_models_kas_bundle.py::TestTheCrewSignInRelay::test_a_refused_gate_serves_the_recording (head 0f40ae4)
Manual verification
Not run on a live gateway: it needs a host signed in through Kiro Crew with kiro-cli signed out, and this host has neither account to sign in with. The handler tests drive
api_modelsend to end with the route, latch and vault replaced.Related Issues
Part of #27049
Sibling sweep
Swept: git grep -n "reject_if_kiro_unverified(" -- src/kiro_crew
Sibling: src/kiro_crew/dashboard/chat_regenerate.py -- tracked in #27049
Sibling: src/kiro_crew/dashboard/chat_rewind.py -- tracked in #27049
Sibling: src/kiro_crew/dashboard/openai_compat.py -- tracked in #27049
Sibling: src/kiro_crew/dashboard/handlers/sessions.py -- not affected -- the usage routes skip the gate when the vault owns usage
Sibling: src/kiro_crew/dashboard/handlers/agents.py:1359 -- not affected -- the background
--list-modelsrefresh runs only on the kiro-cli path this change leaves as isPattern harvest
Not generalizable: the kiro-cli gate is right for every kiro-cli spawn; the one-off is a KAS relay that takes its credential from Kiro Crew's vault, now named by one predicate the remaining sites will share.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement
Contributed under the project's Apache-2.0 license.