Repository navigation
fix(diagnostics): resolve kiro-cli via resolve_kiro_cli() instead of bare PATH lookup - #7826
adiarora06 wants to merge 1 commit into
Conversation
…bare PATH lookup _kiro_cli_version() spawned the bare name ["kiro-cli", "--version"], which only resolves through the collector process's own inherited PATH. A desktop app launched from Finder/Dock on macOS inherits launchd's minimal PATH (no ~/.local/bin), so a working install reported 'unavailable' -- indistinguishable from 'not installed' -- in both versions.txt and the prefilled bug-report footer, even while the gateway successfully ran the same binary via resolve_kiro_cli(). Resolve through resolve_kiro_cli() first (the same fixed-dir search the gateway and ACP launch paths already use), spawn the absolute path it returns, and reserve 'unavailable' for the resolver genuinely finding nothing. A resolved binary that fails to run now reports 'present but not runnable' instead of collapsing onto the same string. Closes kirodotdev#7674 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
👋 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. |
3 similar comments
|
👋 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. |
|
👋 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. |
|
👋 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. |
Closing — a duplicate of #7692, which is the more hardened versionVerified relationship: Both PRs repair the same defect in the same function, This was adjudicated twice, independently; the second reviewer reached the same ruling ( src/kiro_crew/diagnostics.py — both diffs start from the same blob ( Evidence (1) src/kiro_crew/diagnostics.py, same hunk both sides: #7826 Why this one and not the otherYes — #7692 is the right survivor. It is the strict superset in production behaviour (non-zero-exit handling, broad containment, scrub_env child environment, run_limited ceiling), it moves the two riders #7826 leaves stale, it carries 6 mutation-checked tests versus 4, and it is the reviewed branch (Design PASS, First Principles PASS, Opus 4.8 clean, four documented review rounds) against #7826's zero reviews and unmet PR-template gate. The apparent counter-argument — #7692's open GPT 5.6 [BLOCK-MERGE] demanding a revert of the resolver-based spawn — does not favour #7826, because #7826 makes the identical resolver-selected spawn with none of the mitigations, so it inherits the same finding in a weaker form. That block is a merge-readiness question about the shared design, not a reason to prefer the unreviewed subset. Carry this over firstThis closure is about redundancy, and these items are the exception: they are not on One test, worth porting but not blocking: #7826's From a repository-wide duplicate/overlap audit of every pull request open against |
Closes #7674
Root cause
_kiro_cli_version()(src/kiro_crew/diagnostics.py) spawned the bare name["kiro-cli", "--version"], which resolves only through the collector process's own inheritedPATH. A desktop app launched from Finder/Dock on macOS inherits launchd's minimalPATH, not the login shell's, so~/.local/bin(and similar install dirs) are absent from the collector's environment even when the CLI is installed there and the gateway is successfully spawning it throughresolve_kiro_cli().The result: a working install reported
kiro-cli: unavailablein both places a maintainer reads first —versions.txtin the diagnostics bundle and the prefilled bug-report footer — indistinguishable from "not installed," and this false signal had already misdirected two triage passes on #3084 and spawned #7233.Fix
_kiro_cli_version()now resolves the binary throughresolve_kiro_cli()(src/kiro_crew/kiro_cli.py) — the same fixed-dir +PATHsearch the gateway and ACP launch paths already use — and spawns the absolute path it returns:unavailableis now reported only when the resolver genuinely finds nothing.present but not runnableinstead of collapsing onto the same "not installed" string.Both user-visible call sites (
_versions_text()and the issue-template footer in_issue_url()) share_kiro_cli_version(), so the one fix covers both.Testing
Added
TestKiroCliVersionProbetotest/test_diagnostics.py:known_kiro_cli_dirs()entry (~/.local/bin) while the inheritedPATHexcludes it entirely (the exact scenario from the bundle evidence in the issue)unavailablewhen the resolver finds nothingpresent but not runnable(notunavailable) for a resolved-but-broken binary.venv/bin/python3 -m pytest test/test_diagnostics.py -q→ 50 passed.Also ran
test/test_env.py,test/test_cli_doctor.py,test/test_kiro_prerequisite.py,test/test_acp_client.py— all pass except one pre-existing, unrelated failure (TestResolveKiroBinEnvOverride::test_spawn_passes_installed_path_through_exact_wrappers, apass_fds/platform assertion that fails identically on a cleanupstream/maincheckout).black/isort/flake8/mypyrun on touched files: no new issues introduced by this change (the local venv'sblackdisagrees with pre-existing formatting in both files unrelated to my edits — verified the diffblack --diffproposes doesn't touch any of the lines I added).No
CHANGELOG.mdchanges, per this repo's fix-PR convention.🤖 Generated with Claude Code