Repository navigation
fix: recognise the windows toolbox launcher in the doctor cli row - #35530
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: a diagnostic-only widening, guarded by the unchanged version probe. Notes
[DESIGN-REVIEWED] fb3a15d Description read[DESCRIPTION-READ] 9c494eee13e9586bbaf392487d1178c985c8c3643cabceb57501cc2bb9b7242b 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 Nothing blocks. This is a fix for #32803, made in the two gates that caused the false warning. Inventory (4 items) — 4 justifiedIntent: on a Windows Toolbox install,
[FIRST-PRINCIPLES-REVIEWED] fb3a15d Description read[DESCRIPTION-READ] 8a8fc91564d1ed02b76ce531c84557d0dc0b752a75e1c8f486f599e29fc52f93 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: |
7eda1a1 to
fb0cac0
Compare
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: |
On a Windows install managed by Toolbox, `kirocrew doctor` always said the `kirocrew` on PATH belonged to a different install. The Toolbox check only knew the POSIX layout: the launcher had to resolve to the shared `toolbox-exec` dispatcher, and the install had to run from under `~/.toolbox`. On Windows the launcher is `%LOCALAPPDATA%\Toolbox\bin\kirocrew.exe` and the install lives under `%LOCALAPPDATA%\Toolbox`, so neither gate passed. The row now also accepts a launcher whose directory is the Windows Toolbox bin directory, and `is_toolbox_install` also accepts an interpreter under the Windows Toolbox root. Both paths come from one new `env._windows_toolbox_root`, which `_windows_toolbox_bin_dir` now builds on. The version probe after the gates is unchanged: sandboxed, and clean only on an exact version-line match. Fixes #32803
fb0cac0 to
fb3a15d
Compare
Code change approver recommendation: ApproveWhy: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes. This PR widens the two gates behind the doctor CLI row so they recognise the Windows Toolbox layout:
I checked the code rather than trusting the description:
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.
Approved. Verified on head fb3a15d: the _windows_toolbox_bin_dir refactor returns the same path as before, because _validated_bin_dir only checks shape. POSIX behaviour is unchanged. Both new branches sit behind IS_WINDOWS. The exact-version probe still decides the row and still runs through the strict sandbox wrapper. Mutation runs show that reverting either fix hunk turns test_same_version_through_the_toolbox_bin_launcher_is_clean red. PR Readiness is green on this head, including all Windows backend shards.
Done well: _windows_toolbox_root is now the one owner of the Windows Toolbox location, so the doctor gate and the PATH builder cannot disagree. The new tests drive the real is_toolbox_install and cover the negative cases too.
- Optional:
test_the_windows_layout_is_not_read_off_windowsdoes not pin theIS_WINDOWSgate in_is_toolbox_launcher, because the gate inis_toolbox_installhides it. Asserting_is_toolbox_launcher(str(launcher)) is Falsethere would close that gap. - Optional: the Proof line in
## Testsnames head 7eda1a1. Refresh it to fb3a15d the next time the body is edited. - Optional: one rewrapped docstring line in
doctor_checks/install.py(line 297) is 101 characters long.
Problem / Motivation
Goal: On a Windows install managed by Toolbox,
kirocrew doctorstops saying thekirocrewon PATH belongs to a different install when it runs this same install's version.Every
kirocrew doctorrun on a Windows Toolbox install prints "kirocrew CLI on PATH belongs to a different install than this one", even though%LOCALAPPDATA%\Toolbox\bin\kirocrew.exeruns this install's version. The Toolbox check behind that row only knew the POSIX layout.Why it matters
The warning tells the user to run
kirocrew setupfrom the install that should own the name, which on this layout acts on a false premise. An always-on warning also hides the real case the row exists for: another install owning the name.Not a goal
What changed (motivation → approach → change)
The row trusts a Toolbox launcher only when two gates pass: the PATH entry resolves to the POSIX
toolbox-execdispatcher, and the running interpreter lives under~/.toolbox. On Windows the launcher is a per-toolkirocrew.exein%LOCALAPPDATA%\Toolbox\binand the install lives under%LOCALAPPDATA%\Toolbox, so both gates failed and the row fell through to the warning.env.is_toolbox_installalso accepts an interpreter under the Windows Toolbox root.env._windows_toolbox_root;_windows_toolbox_bin_diris nowbinunder it and returns the same path as before.Backwards compatibility
Compatible: on POSIX both gates behave as before, and on Windows they only accept more; the version probe still decides.
Removes nothing: the change only widens which layouts the two gates recognise.
Tests
test/test_cli_doctor_install.py::TestWindowsToolboxPathLauncherdrives the realis_toolbox_installand the doctor row withIS_WINDOWSandLOCALAPPDATApinned:(Toolbox launcher, same version)row, andis_toolbox_install()is True;kirocrew.exeoutside the Toolbox bin directory is never probed;is_toolbox_install()is False;The existing POSIX
TestToolboxPathLaunchertests pass unchanged.Proof: PROVEN test/test_cli_doctor_install.py::TestWindowsToolboxPathLauncher::test_same_version_through_the_toolbox_bin_launcher_is_clean (head 7eda1a1)
Manual verification
Not run on a real Windows Toolbox host; the tests pin the Windows layout on Linux. Case-insensitive path matching rests on
os.path.normcase, which only lowercases on Windows, so the Windows CI shard is the run that exercises it.Related Issues
Fixes #32803
Related: #23172 and #24665 (the POSIX half), #24563 (added
_windows_toolbox_bin_dir).Sibling sweep
Swept: git grep -nE '".toolbox"|toolbox-exec|.toolbox/' -- 'src/*.py'
Sibling: src/kiro_crew/doctor_checks/install.py -- changed here
Sibling: src/kiro_crew/env.py -- changed here
Sibling: src/kiro_crew/service/common.py -- not affected -- builds POSIX service unit paths only
Sibling: src/kiro_crew/instances/token_mint.py -- not affected -- a POSIX launcher candidate list, not an install-ownership check
Pattern harvest
Not generalizable: a platform layout the POSIX fix declared out of scope; the general rule (route platform paths through one helper per platform) is already how
envbuilds the Windows Toolbox bin directory.Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)