kiro-cli --v3: `execute_pwsh` escapes double quotes to `\"` on Windows, breaking every quoted command
Before opening, please confirm:
- [x] I have searched for duplicate or closed issues
Operating System
Windows11
Kiro Version
2.13.0
Bug Description
This behavior does not occur in v2. Only after upgrading to v3 does the command become incorrectly escaped.
On Windows, the execute_pwsh tool escapes any double quote (") in the command
string into a literal \" before handing it to the shell. This corrupts both
native cmd commands and any pwsh/powershell -Command "..." invocation, so no
command containing double quotes can execute correctly.
Steps to Reproduce
echo "hello with quotes"pwsh -NoProfile -Command "1+1"powershell -NoProfile -Command "Write-Output 'x'; (2+3)"
Expected Behavior
Expected result
hello with quotes2xthen5
Conversation ID
No response
Additional Context
This behavior does not occur in v2. The exact same agent instructions, prompts, and environment execute successfully in v2. Only after upgrading to v3 does the command become incorrectly escaped.
🤖 Potential Duplicate Detected
This issue appears to be similar to:
- #10006: execute_pwsh tool collapses consecutive spaces in command strings (82% similar)
- #7431: [Bug] Shell tool fails on Windows native kiro-cli 2.0 (82% similar)
What happens next?
- ⏰ This issue will be automatically closed in 3 days
- 🏷️ If this is not a duplicate, you can prevent automatic closure by adding a comment or reacting with 👎 to this message.
- 💬 Comment on the original issue if you have additional information
Why is this marked as duplicate? Both issues report bugs with the 'execute_pwsh' tool on Windows that corrupt command strings - Issue #10006 reports consecutive spaces being collapsed, while the new issue reports double quotes being escaped to '"'. Same tool, same OS, same category of string-mangling bug in command execution.
This does not appear to be a duplicate of #10006.
Issue #10006 is specifically about consecutive spaces being collapsed.
This issue is about double quotes being escaped as \", which causes
PowerShell command parsing failures.
They may belong to the same general category (command string corruption), but they have different symptoms, different reproduction steps, and potentially different root causes.
More importantly, this issue is a regression introduced in V3:
- V2 executes the same commands correctly
- V3 rewrites quoted strings and breaks execution
Examples that fail due to quote escaping:
Write-Host "hello"
git commit -m "message"
python -c "print('hello')"
Thank you for your feedback! 🙏
The duplicate label has been removed and this issue has been sent back for maintainer review.
A maintainer will review this issue shortly.
Thanks for the clear report and the v2/v3 comparison.
This might be caused by Node.js's spawn() on Windows escaping arguments for the CreateProcess API. The v3 agent passes the command to spawn(shell, ['-Command', command]) without windowsVerbatimArguments: true — so Node.js applies its default Windows argument escaping, converting " to \" in the command-line string before PowerShell sees it.
v2 doesn't have this because it uses Rust's Command which handles Windows quoting differently.
#10173 is a duplicate of this issue. Marking as bug to investigate further.
This appears to be a regression between v2 and v3 and currently blocks our use of the CLI on Windows because nearly all execute_pwsh commands containing quotes fail. Any status update would be appreciated.
This was reported against CLI 2.13.0. Could you retest with the current version (CLI 2.19.x)? We made changes to the PowerShell command handling path in subsequent releases. To update: download from kiro.dev.
This issue has been automatically closed due to inactivity. It has been 7 days since we requested additional information.
If you still need help with this issue, please feel free to reopen it or create a new issue with the requested details.