Repository navigation
Conversation
|
👋 Hi! This PR's description is missing some required sections from our PR template. Workflow runs won't be auto-approved until the description is updated. Missing sections:
Please update your PR description to include these sections, then push or re-save the description. The workflows will be approved on the next cycle. |
Design Review (Fable 5, fork) — 🔴 BLOCK (blocking)Design-level review of Design-Verdict: BLOCK Stale duplicate: main already fixed kiro-cli #4243 (#9840); merging this reverts the landed pty driver, dir guard, and pinned-target gating, breaking every device login. BlockersSuperseded fix whose diff now reverts three landed decisions and breaks the login path. [DESIGN-REVIEWED] aad5aee |
First Principles Review (Fable 5, fork) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK Both fixes already exist on base: the Python pty driver and the pinned no-fallback IdC branch — this diff deletes them and re-ships a second spelling. Not justified as shipped
What this change shipsInventory (7 items) — 0 justifiedIntent: make automated IAM Identity Center sign-in on a cloud launch complete without a human at the box — a FIX.
Blockers
[FIRST-PRINCIPLES-REVIEWED] aad5aee |
GPT 5.6 Review (fork) — 🔴 changes requested (blocking)Reviewed 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/cloud/login.py:843 -- private login-directory guard was removed Adjudication (Opus 5) — is blocking on each finding proportionate?F1 — src/kiro_crew/cloud/login.py:843 (new) / :841 (base) Harm rung: UNBOUNDED as fenced — the removed snippet is the sole definition of the private, symlink-refusing, owner-checked Conditions confirmed: the guard is spliced by every other remote script that touches those paths ( Rarity: none. This is not an extreme condition combination — it is the only path |
Opus 5 Review (fork) — 🔴 changes requested (blocking)Reviewed BLOCKING — [BLOCK-MERGE] aad5aee BLOCKING — src/kiro_crew/cloud/login.py:497 if identity_provider:
idc_region = idp_region or region
... f"--license {license_ or 'pro'} " f"--identity-provider {identity_provider} --region {idc_region}"
BLOCKING — src/kiro_crew/cloud/login.py:843 export KIRO # so the pty/subshell on the enterprise path can resolve the binaryThis replaces BLOCKING — src/kiro_crew/cloud/login.py:816 inner = f'"$KIRO" login --use-device-flow{extra_flags} >"{_LOGIN_LOG_PATH}" 2>&1'
[OPUS-REVIEWED] aad5aee |
9259a31 to
5e85ca9
Compare
5e85ca9 to
2378643
Compare
|
Thanks for the reviews — pushed a revision ( GPT 5.6 (log capture) — fixed. You're right: First Principles (BLOCK) — subtractions applied.
On the core BLOCK (all IdC logins routed through the pty, unverified on flag-honoring builds): with the log-capture fix, a build that honors the flags prints the device URL straight to the redirected log and the fed newlines are consumed by the pty with no prompt to answer — so the pty path is non-breaking there by construction, not by assumption. I can only test the affected build (Amazon Linux 2023 arm64, kiro-cli as shipped by the launcher's own bootstrap); I don't have a flag-honoring build to name. If a maintainer can confirm on one, I'll cite it; otherwise I'm happy to gate the pty strictly behind Design Review (CONCERNS) — acknowledged.
PR Hygiene / description bot: changed the heading to a literal Opus 4.8 found no blocking issues and confirmed the shlex-quoting survives the nested |
bca742a to
801bdcf
Compare
…cli kirodotdev#4243) The enterprise sign-in path passes --identity-provider/--region to kiro-cli login, but several kiro-cli builds still show interactive prompts 'Enter Start URL' / 'Enter Region' (only --license is honored non-interactively) — kiro-cli kirodotdev#4243. Those prompts are a TUI widget that reads the CONTROLLING TTY, not stdin. The launcher runs login in the background over SSM with no tty and stdin from /dev/null, so the prompts never render or submit, no device-code URL is printed, capture times out, and start_device_login wrongly falls back to the social/callback path (confusing 'Google/GitHub needs a forwarded port' message). The flags DO pre-fill each prompt's default; the widget just needs a tty and an Enter per field. Fix, in _device_login_command: on the enterprise path run login under a pseudo-tty via util-linux 'script -qec' and feed newlines into that pty (printf '\n\n\n' piped in) to submit the pre-filled values. Verified on Amazon Linux 2023: this emits the device-code URL with no human interaction. KIRO is exported so the script/sh -c subshell resolves the binary. If 'script' is absent, fall back to a direct run with newlines on stdin. The Builder ID / social path keeps no pty and stdin </dev/null, byte-for-byte unchanged. Also in start_device_login: on the Identity Center path there is no social/callback flow, so report an honest device-code timeout instead of falling through to _start_callback_login. Tests: Builder ID path unchanged; IdC path runs under 'script -qec' with fed newlines and exports KIRO; values are shell-quoted (injection); the resume command threads the same; an IdC timeout does not chase a social callback port.
e6fa683 to
1891f6e
Compare
|
Kiro Crew [operator: chenmingwei23#de330d0c]: Security scan flagged this PR for manual review. Findings:
A maintainer will review before any automated action is taken. |
|
Closing as superseded by PR #9840 Thanks for working on the IAM Identity Center device-login problem. PR #9840 ( Where main already has each goal (line numbers are on origin/main):
At the audited head
A rebase would not rescue it. The diff would end up either empty or removing main's code. Two small things main doesn't have. Neither is worth keeping this open:
If main's From a full open-PR audit against origin/main c66f95b (2026-09-25); findings were checked by independent reviewers reading the code. Reply here if this is wrong. |
Problem / Motivation
kirocrew cloud launch/kirocrew cloud logincan sign the on-boxkiro-cliinto an enterprise IAM Identity Center by passing--identity-provider/--license pro/--idp-regiontokiro-cli login.But several
kiro-clibuilds still show the interactive promptsEnter Start URL/Enter Region(only--licenseis honored non-interactively) — kiro-cli issue #4243. Those prompts are a TUI widget that reads the controlling TTY, not stdin.The launcher runs
kiro-cli loginin the background over SSM with no tty and stdin from/dev/null. The prompts never render or submit, no device-code URL is printed, the capture loop times out, andstart_device_loginthen falls through to the social/callback-port path — a misleading "Google/GitHub sign-in needs a forwarded callback port" message for what is actually an Identity Center login. Automated step-5 sign-in never completes.Reproduced on a live deployment (Amazon Linux 2023, arm64). Under a pty with the pre-filled prompts submitted, the device code prints with no human typing:
Feeding the answers on stdin (a file or pipe redirect) does not work — the widget reads the tty, not stdin. A bare pty with no input parks at the first prompt. It takes a pty and the newlines fed into it.
Why it matters
Every enterprise / IAM Identity Center user on an affected
kiro-clibuild is blocked: the one-commandkirocrew cloud launchthat should end with a working box instead leaves them signed out, the dashboard errors on every new chat, and the on-screen guidance points at the wrong problem (a social-login callback port). The only workaround today is to SSM onto the box and runkiro-cli loginby hand asec2-user, answering the prompts — which defeats the automated launcher and is not discoverable.What changed
Observed symptom: automated IdC sign-in stalls with no device code, then reports a bogus callback-port error.
Root cause: (1) the prompts are a TUI widget bound to the controlling tty, but the background login has no tty and stdin
</dev/null, so nothing renders or submits them; (2) the no-URL branch ofstart_device_loginunconditionally falls through to the social/callback flow, which does not exist for Identity Center.Change, in
src/kiro_crew/cloud/login.py:_device_login_command— on the enterprise path (identity_providerset), runkiro-cli loginunder a pseudo-tty via util-linuxscriptand feed newlines into that pty to submit the flag-prefilled prompts. The login command's own stdout/stderr is redirected to the capture log;script's typescript goes to/dev/nullso the log holds the device-code URL, not the pty transcript (whose echoed "Enter Start URL · https://…" line would otherwise be captured instead).KIROis exported so thescript/sh -csubshell resolves the binary. The Builder ID / social path is byte-for-byte unchanged (no pty, stdin</dev/null).start_device_login— on the Identity Center path, return an honest device-code timeout instead of falling through to_start_callback_login.Considered and rejected: feeding the answers on stdin (a file redirect or a
printf |pipe / bash process substitution) — proven on the box not to reach the tty-bound widget; only widening the capture window — doesn't help when the prompt never submits; a bare pty with no fed input — parks at the first prompt.Tests
test/test_cloud_login.pyaddsTestDeviceLoginIdentityCenterandTestStartDeviceLoginFallback:--use-device-flow, no pty, stdin</dev/null, no enterprise flags.script,printffeeds the newlines,KIROis exported, login output goes to the log.shlex.quoted and cannot escape into the remote shell._resume_login_commandthreads the same pty behavior; the default variant does not._start_callback_loginand returns an "Identity Center" error.Manual verification
Verified end-to-end on a real deployment (Amazon Linux 2023 arm64, IAM Identity Center start URL, eu-central-1): the invocation the fix generates emits a
…#/device?user_code=XXXX-XXXXURL with no human at the box; the prior</dev/nulland stdin-redirect attempts produced only the un-submitted prompt line, which pinned the tty-vs-stdin root cause.Note: the project's
pytestsuite was not run in my local environment (no dev venv available); the added tests were exercised with an equivalent standalone runner. CI on this PR runs the real suite.Related Issues
Upstream root cause: kirodotdev/Kiro#4243 (kiro-cli's Identity Center prompts appear despite the flags and read the tty).
Pattern harvest
Rule candidate: review-prompt
Pattern: automating a CLI that uses an interactive TUI prompt (dialoguer/inquire-style) requires a pseudo-tty, not stdin redirection — those widgets read
/dev/tty, so</dev/nullor a piped/file stdin never reaches them; allocate a pty (util-linuxscript) and feed the keystrokes into it. Also: a "no result" branch that falls through to an unrelated recovery path (here, social-login callback) should be gated on the mode that actually supports it, so failures report the true cause.Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)