fix(kiro): discover and spawn Kiro CLI from Windows npm shims (#826)#842
Open
evanclan wants to merge 11 commits into
Open
fix(kiro): discover and spawn Kiro CLI from Windows npm shims (#826)#842evanclan wants to merge 11 commits into
evanclan wants to merge 11 commits into
Conversation
…oringhq#826) Kiro still used the shared PATH lookup that returns extensionless npm wrappers first and spawned .cmd shims directly. Mirror the Pi/Codex Windows shim handling so `where kiro-cli` prefers .cmd/.exe and chat spawns resolve through command_target_avoiding_windows_cmd_shim.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends the Windows npm-shim fix landed for Pi in #826 to Kiro CLI. Kiro was the only agent still using the shared
find_cli_binaryPATH lookup and direct.cmdspawning, so Windows installs could be discovered as an extensionless wrapper and then fail to launch with "batch file arguments are invalid".Problem
On Windows,
where kiro-clireturns both an extensionless npm wrapper andkiro-cli.cmd. The sharedcli_agent_runtime::first_existing_pathreturned the first existing line, andkiro_clispawned that path directly:Pi, Codex, Claude, Gemini, and OpenCode already prefer
.cmd/.exeduring discovery and resolve shims throughcommand_target_avoiding_windows_cmd_shimbefore passing prompt/chat args.Solution
cli_agent_runtime::first_existing_pathto skip extensionless wrappers on Windows (same rule aspi_discovery.rs).kiro_discoverycandidate paths with Windows npm/pnpm/volta/scoop.cmd/.exeinstalls.command_target_avoiding_windows_cmd_shim, matchingcodex_cli.rs/pi_config.rs.Out of scope
main).Test plan
cargo test kiro— shim resolution + discovery candidate coveragecargo test first_existing— shared Windows PATH preference regressionRelated
Made with Cursor