Repository navigation
fix(kas): enter a Crew-owned KAS spawn through kiro-cli-chat - #14982
Conversation
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify a fresh non-desktop dashboard sign-in reaches chat past the whoami-keyed readiness gate — the fix was proven manually only via [DESIGN-REVIEWED] a6c21a8 Description read[DESCRIPTION-READ] 07e459c5397d7be0449577b51341a00a49097dbab6bc67716cd1735fa556734b 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 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the diff's non-KAS hunks are main's already-merged #14896 riding a stale base — a rebase should leave only the KAS commit. Not justified as shipped
What this change shipsInventory (6 items) — 5 justifiedIntent: FIX — a user signed in through Kiro Crew's own vault can chat on the KAS backend even when kiro-cli itself is signed out. Defect provenance is checkable: a reproduction table in the description and
[FIRST-PRINCIPLES-REVIEWED] a6c21a8 Description read[DESCRIPTION-READ] 7c0cf18739e88735f2bc519c20f7cc77a3e85ef4989f97f5cb161b82f9da4d8d That sha256 names the PR description this verdict read. Recompute it with |
Opus 5 Review — ✅ no blocking findingsReviewed Review detailsNothing blocks; one advisory: the KAS doctor line now reports a relay argv the runtime will not spawn. FINDING — src/kiro_crew/cli_doctor.py:1524 — with [OPUS-REVIEWED] a6c21a8 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
The POSIX `kiro-cli` is the q_cli launcher. It checks its OWN sign-in before it execs `kiro-cli-chat` for `acp`, with or without `--auth-method cli`. A Crew-owned KAS spawn exists for the host where kiro-cli is signed out (Crew's vault holds the identity), so through the launcher it exited "You are not logged in" and the engine never asked Crew for the credential. Measured on kiro-cli 2.25.0 in a container with kiro-cli signed out and an IdC identity in Crew's vault: the launcher exits 1; `kiro-cli-chat acp --agent-engine v3` starts KAS in `--auth=acp-callback` and the turn completes. `kiro_cli.chat_sibling` returns the executable, non-empty `kiro-cli-chat` in the same directory as a resolved `kiro-cli`, or None. The KAS harness consults it on the Crew-owned branch only and never for an explicit KIROCREW_KIRO_BIN; the cli-owned spawn keeps the launcher, since it needs kiro-cli signed in anyway. Every miss (Windows, whose one kiro-cli.exe is the chat-cli crate itself; operator override; bundled entry; no or empty sibling) leaves the resolved binary as it was, which is today's behaviour. The desktop bundle already enters through the chat binary for the same reason.
23765fc to
a6c21a8
Compare
UX Review (Fable 5) — ✅ PASSUX-level review of UX-Verdict: PASS Verify the deferred dashboard readiness gate (kiro-cli The diff changes no user-visible control — backend spawn selection, a path helper, specs, tests; the only string change is an operator log line — so the absent screenshots are not an evidence gap. [UX-REVIEWED] a6c21a8 Description read[DESCRIPTION-READ] fb15b6d94e3d8de90736cd7e8965d61d10e7bf4a45ede95f88ec6537fa2ff1dd That sha256 names everything this verdict read: the PR description, plus the 3 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 |
bolichen97
left a comment
There was a problem hiding this comment.
Reviewed on behalf of the maintainers (sweep 2026-09-29): readiness passed, required checks green on a6c21a8, no blocking review threads, security posture unchanged. Approving and merging.
…release/0.8.0) (#17271) Backport of #16131, #16700 and #17250 to release/0.8.0, plus the kiro_cli.chat_sibling helper #16131 calls (from #14982; only the helper, not #14982's KAS spawn change). - #16131: ASBX_KIRO_MANDATORY_MCPS no longer pins every Crew-owned MCP server resident. They defer under Tool Search when the spawn runs the pinned kiro-cli (or its chat sibling) at >= 2.27.0; any other binary or version keeps them resident. An operator's ambient value still wins. - #16700: a deferred call's rawInput is {"tool_id", "arguments"}; the directive consumer now digests the arguments, so monitor_start, monitor_update and autonudge_stop claim their parked record instead of being dropped with CLAIM MISS input-differs. - #17250: the bundled kiro-cli moves from 2.24.0 to 2.27.1, without which the >= 2.27.0 gate never opens on a desktop install. - chat_sibling: without it mandatory_mcps_drop_allowed raises NameError, which it swallows, so deferral would silently never apply on this branch. (cherry picked from commits af16284, af2619f, 9348a25)
Problem / Motivation
Goal: A user who signed in through Kiro Crew's own Kiro sign-in can chat on the KAS backend even when
kiro-cliitself is signed out.Bug fix. After a successful Kiro Crew sign-in (Crew's vault holds the identity), the first KAS session on a pip / Docker / Linux install still died with kiro-cli's own error:
You are not logged in, please log in with kiro-cli login. The Crew-owned spawn — the mode that exists precisely so kiro-cli need not be signed in — never reached the engine.Root cause: the POSIX
kiro-cliis the q_cli launcher (install / update / doctor / login / shell completion). Forchatandacpit execskiro-cli-chat, but only after checking its own sign-in, with or without--auth-method cli. Sokiro-cli acp --agent-engine v3exits 1 at the launcher and_kiro/auth/getAccessTokenis never sent.kiro-cli-chat acp --agent-engine v3has no such gate and starts KAS in--auth=acp-callback.Why it matters
Every non-desktop install (pip, Docker image, Linux install.sh, macOS
Kiro CLI.appresolved from PATH) that relies on Kiro Crew's own sign-in is broken until the user also runskiro-cli login— which defeats the feature and, for org SSO users, means two sign-ins for one identity. The desktop app is unaffected only because its bundle already enters throughkiro-cli-chat.Not a goal
--auth-method cli): it needs kiro-cli signed in anyway.whoami(returning users are unaffected: the turn is the authority).What changed (motivation → approach → change)
Motivation: the Crew-owned spawn must not pass through a process that refuses to run without kiro-cli's sign-in.
Approach: enter through the chat binary the launcher would have exec'd anyway — the same choice the desktop bundle already makes (
BUNDLED_KIRO_CLI_ENTRY) — and only where that binary provably sits beside the resolved launcher.kiro_cli.chat_sibling(binary, platform_name=None): the executable, non-emptykiro-cli-chatin the same directory as a binary namedkiro-cli, elseNone. Purestat.Noneon Windows (the MSI ships onekiro-cli.exethat IS the chat-cli crate — no launcher, verified by extracting 2.25.0), for any other name (the bundled entry is already the chat binary), for an empty file (ENOEXEC would fail louder than the launcher), and when no sibling exists. The directory is the resolved path's own, never its realpath, per the launch-in-place rule.acp/harness/kas.py: on the Crew-owned branch only, swap the resolved binary for the sibling when there is one, except when the resolved binary is the operator'sKIROCREW_KIRO_BIN(their wrapper is exactly what they asked for). The log line names the binary chosen. The cli-owned branch is untouched.kas-auth.mdstatus paragraph;acp-client.mdresolver paragraph.Evidence (kiro-cli 2.25.0, Debian container, kiro-cli signed out, IdC identity in Crew's vault):
kiro-cli acp --agent-engine v3(no--auth-method)error: You are not logged in, please log in with kiro-cli login, rc=1kiro-cli-chat acp --agent-engine v3[INFO] Auth: --auth=acp-callback (host-mediated refresh via _kiro/auth/getAccessToken)kirocrew chat -m "Reply with exactly the word PONG"on mainAcpAuthRequired: Not signed in to KiroKIROCREW_KIRO_BINPONGThe gate lives in the launcher (source paths
crates/q_cli/...in that binary), not inkiro-team/kiro-cli'schat-clicrate, whoseexecute_kas_acpmaps a missing--auth-methodtoRelayAuth::Clientcorrectly.Backwards compatibility
Nothing is rejected, renamed or removed. Every miss (Windows, operator override, bundled entry, no sibling, empty sibling, cli-owned spawn) leaves the argv exactly as main builds it.
install.sh, Docker image (/usr/local/bin)kiro-cli+kiro-cli-chatside by sideKiro CLI.app/Contents/MacOS/kiro-cli-chatkiro-cli.exekiro-cliKIROCREW_KIRO_BINTests
test/test_kas_spawn_chat_sibling.py:chat_sibling: sibling found; launcher alone; non-executable sibling (POSIX-only); empty executable sibling; names other thankiro-cli; win32; empty input; symlinked launcher keeps its own directory (requires_symlinks).chat_siblingstubbed so the plumbing is asserted on every CI host): Crew-owned swaps and drops--auth-method; cli-owned keeps the launcher, keeps the flag, and never consults the sibling; no sibling keeps the resolved binary;KIROCREW_KIRO_BINnaming the launcher is never swapped; an override naming a different binary does not pin this one.Ran locally with
test_acp_harness_contract.pyandtest_kas_spawn.py: 146 passed. black / isort / flake8 / mypy clean on the changed files.Manual verification
Container built from this branch (
python:3.12-slim-trixie+ kiro-cli 2.25.0 from the release manifest),agent.acp_backend=kas, kiro-cli signed out, Crew vault signed in via IdC device code:kirocrew chat -m ...returns the model's reply;kirocrew doctorshowsauth owner: Kiro Crew vault. Same container on main:AcpAuthRequired. Windows: MSI 2.25.0 extracted with msitools — one file,LocalApp/Kiro-Cli/kiro-cli.exe, whose embedded source paths arecrates\chat-cli\...with noq_cli, so no launcher gate exists there.Screenshots / video
Not applicable — no user-visible UI change.
Related Issues
None filed; root-caused in a Kiro Crew maintainer session on 2026-09-29.
Pattern harvest
Not generalizable: the defect is one upstream launcher's sign-in gate applied to a subcommand that delegates auth to its caller. The one general lesson is already encoded in
BUNDLED_KIRO_CLI_ENTRY's comment (enter through the chat binary), and this PR extends that rule to the one remaining path that still went through the launcher.Checklist
kas-auth.md,acp-client.md)