When Cmd is the default terminal, the Agent isn’t properly detecting that and reporting it to the model, so the model tries using PowerShell specific commands and syntax, which result in errors in Cmd.
This was confirmed as a known bug in the following reply, but I’m creating a separate post for visibility to other users and so we can track progress on getting it resolved:
Similar behavior is also mentioned in the following old posts, but no resolution was provided:
Steps to Reproduce
The bug is intermittent, but you set your default terminal to Cmd and start an agent prompt that will trigger calls to the terminal tool. The model may try to use PowerShell commands and syntax, resulting in an error.
Expected Behavior
The agent correctly reports which terminal is active (i.e. Cmd), and the model never tries to run commands that will only work in a different terminal (i.e. PowerShell).
For AI issues: add Request ID with privacy disabled
I can’t disable privacy on my company managed team account.
Additional Information
This bug not only increases the processing time of the prompt, the erroneous terminal tool call also results in more cache read token sage, which increases the cost of the prompt. See also:
Hey, thanks for making a separate post so it’s easier to see. This is a known bug. On Windows, the agent’s shell detection defaults to PowerShell no matter what terminal profile you’ve set.
Your .cursor/rules workaround is the best option right now:
When running terminal commands, always use cmd.exe syntax, not PowerShell. The default shell is Command Prompt.
The team knows about the issue. There’s no ETA for a fix yet, but your report and the others you linked help us prioritize it.
Let me know if the rules workaround still isn’t enough.