Skip to content

fix(kiro): discover and spawn Kiro CLI from Windows npm shims (#826)#842

Open
evanclan wants to merge 11 commits into
refactoringhq:mainfrom
evanclan:fix/kiro-cli-windows-spawn-shim
Open

fix(kiro): discover and spawn Kiro CLI from Windows npm shims (#826)#842
evanclan wants to merge 11 commits into
refactoringhq:mainfrom
evanclan:fix/kiro-cli-windows-spawn-shim

Conversation

@evanclan

@evanclan evanclan commented Jun 9, 2026

Copy link
Copy Markdown

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_binary PATH lookup and direct .cmd spawning, 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-cli returns both an extensionless npm wrapper and kiro-cli.cmd. The shared cli_agent_runtime::first_existing_path returned the first existing line, and kiro_cli spawned that path directly:

// src-tauri/src/kiro_cli.rs (before)
let mut command = crate::hidden_command(binary);

Pi, Codex, Claude, Gemini, and OpenCode already prefer .cmd/.exe during discovery and resolve shims through command_target_avoiding_windows_cmd_shim before passing prompt/chat args.

Solution

  • Teach cli_agent_runtime::first_existing_path to skip extensionless wrappers on Windows (same rule as pi_discovery.rs).
  • Expand kiro_discovery candidate paths with Windows npm/pnpm/volta/scoop .cmd/.exe installs.
  • Build Kiro chat commands through command_target_avoiding_windows_cmd_shim, matching codex_cli.rs / pi_config.rs.

Out of scope

Test plan

  • cargo test kiro — shim resolution + discovery candidate coverage
  • cargo test first_existing — shared Windows PATH preference regression
  • CI on this PR

Related

Made with Cursor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant