Repository navigation
fix(cloud): report a found but refused AWS CLI in the pre-flight instead of not installed - #22162
Conversation
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Check by hand that the reachability probe and [DESIGN-REVIEWED] 5afb369 Description read[DESCRIPTION-READ] 10048aa43f496bc12d683f95f64c0e2038777c52394ff666f4df0cf0a39e4a29 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 |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Check before merge: What this change shipsInventory (8 items) — 8 justifiedIntent: when the
[FIRST-PRINCIPLES-REVIEWED] 5afb369 Description read[DESCRIPTION-READ] 5bb2aefcf02f7c42e512575c964c0152b01bfa1b60448ab8906bb28fcd78e448 That sha256 names the PR description this verdict read. Recompute it with |
UX Review (Opus 5.5) — 🟡 CONCERNSUX-level review of UX-Verdict: CONCERNS The refused-CLI row names a fix ("fix the file's ownership or permissions") that the blind reader could not act on. The raw English reason repeats the sentence above it. Watch
[UX-REVIEWED] 5afb369 Description read[DESCRIPTION-READ] 9b6c2b81ac492e04abf88d20ebd7e896ad40dcfe00e58c74107b729cb4d62965 That sha256 names everything this verdict read: the PR description, plus the 6 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: |
b6f63a6 to
deb8cfd
Compare
|
self-added: no
|
|
self-added: no
|
|
self-added: no
|
deb8cfd to
131485a
Compare
|
self-added: yes
|
|
|
|
self-added: yes
|
|
|
|
Main is red, not this PR: |
131485a to
5b2b7ed
Compare
|
self-added: yes
|
|
|
|
self-added: yes
|
|
|
…ead of not installed
5b2b7ed to
5afb369
Compare
|
self-added: yes
|
|
|
|
|
|
|
|
|
|
Review-ready at 5afb369: PR Readiness passed, all 103 checks green, GPT and Opus clean, and every Design / First Principles / UX item on each head has its own reply. Left for a maintainer:
|
Problem / Motivation
Goal: When the gateway finds an
awsCLI but its safety check refuses to run it, the Remote Crew AWS pre-flight says where it was found and why, the way the Session Manager plugin row does, instead of reporting the CLI as missing.The plugin row tells "not installed" apart from "installed but refused" (#19960). The AWS CLI does not. A refused
awsreads as missing: the dashboard's credentials row showsaws CLI not found — install it first, andkirocrew cloud doctorprintsaws CLI not found — install it. Both send the user to reinstall the same refused file.Why it matters
The common case is a Homebrew install owned by a second account (Workbrew), which the check refuses on purpose. Reinstalling the CLI the same way cannot fix that, so the user follows the hint, re-checks, and gets the same row with no clue why.
Not a goal
PATHholds.chownonly applies inside AWS's plugin install tree.plugin_refused_*sentences or the plugin row.What changed (motivation → approach → change)
A refused CLI looked missing because only the plugin read the resolver's refusal list. The resolver already records every refused candidate (
resolve_aws_tool_bin_with_refusals); nothing asked it aboutaws.aws_cli_refusal()incloud/ssm.pyreads that list foraws, sharing one body withsession_manager_plugin_refusal()and its refusal codes. It never returns a command.RemoteCrewPanel)aws CLI not found — install it first …/api/cloud/preflight(dashboard/handlers_cloud.py, typed inapi/client/cloud.ts)aws_cli_refused_path/_reason/_code/_owner/_owner_uid, read only when credentials did not resolvekirocrew cloud doctor(cli_cloud.py)aws CLI not found — install it (…)aws CLI found at <path> but refused: <reason>+ a next step for that reason; the "AWS not reachable" line says the profile was not checked instead of profile/helper adviceremoteCrewPluginRefusal.tsturns its plugin-only helpers into one shared path for both binaries; the plugin row's output is unchanged. One new string,aws_cli_refused, is in every locale and inen.context.json.The fix sits at the two pre-flight surfaces (dashboard credentials row,
kirocrew cloud doctor).run_aws's shared "aws CLI not found" 127 message, which 35 call sites share, is left in place. The refusal fields are filled only when credentials did not resolve, and the dashboard shows them only then, so a refusal never sits beside a working profile. A next step for a file owned by another account, shared by both rows, is #22203. The Remote Crew on EC2 guide's pre-flight entry gains a bullet for the refused CLI.Backwards compatibility
Compatible: the preflight response only gains optional fields, the plugin row renders the same copy, and a CLI that is found, accepted or truly absent shows what it showed before.
Removes nothing: no key, field, function or path is removed or renamed;
pluginRefusalSentence,pluginRefusalCopyandpluginRefusalReportkeep their signatures.Tests
test/test_cloud_ssm.py::TestAwsCliRefusal: absent CLI → none; accepted → none; the real check's third-account refusal → path,other_owner, uid and no command, even inside the plugin'schowntree; real root-gateway refusal →root_gateway.test/test_cloud_handlers.py: the preflight carries the five CLI fields when credentials fail, and never reads the refusal once they resolve.test/test_cloud_cli.py: the doctor reports found-but-refused with the next step for each ofother_owner,world_writable,root_gateway,strict_policy, with no install link and no profile advice.website/src/test/RemoteCrewPanelPluginRefusal.test.tsx: the rendered credentials row leads with the refusal, keeps the raw reason, has no not-found text, no command, gives the plugin row's ownership step, and links the guide; world-writable keeps the ownership step; the root step; the agent report; null once credentials resolve.All 15 new tests fail on
origin/main(the backend ones withhas no attribute 'aws_cli_refusal', the frontend ones on the missing export).Determinism: the 10 backend tests ran green 10 times in a row and once in a shuffled order (seed 20238). The frontend file ran green 5 times and once with
--sequence.shuffle --sequence.seed=20238.Manual verification
Captured the built SPA with
/api/**answered from fixtures (a local Playwright harness, not committed), asserting the row text before each capture. The gateway's probe of a real refused install is covered by the backend tests that run the real safety check.Screenshots / video
Before (same situation on
main): the row says the CLI is not found.After, a CLI owned by another account (dark):
After, a root gateway (light):
Related Issues
Closes #20238
Pattern harvest
Not generalizable: the resolver's refusal list was read for one of the two binaries it serves; this PR reads it for the other, through the same helper.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)