AI agent cannot run tests when prompted. When asked to push or fetch something from GitHub, it runs commands but does not get any result. Tried changing Java extension versions as well, as I saw it was an issue before, still nothing. Looks like it is in a sandbox and I can’t find the way to get it out.
I turned on Legacy Terminal Tool, tried to give permission to Run everything and Ask every time in Auto-Run mode, nothing helps.
Steps to Reproduce
Prompt AI agent “run test sample()” or “push project to git branchName”
Expected Behavior
Before an update 2 weeks ago, AI agent was running tests and could work with GitHub
This is a known issue on Windows in versions 2.4.21 to 2.4.27. A few users ran into the same thing. The agent runs commands, but it doesn’t get any output.
Please check the DevTools console so we can see why:
Open Developer Tools (Help > Toggle Developer Tools)
Run a command via the agent (anything like mvn test or git status)
Copy the logs from the Console and paste them here (look for errors mentioning “path”, “ENOENT”, or “cursor-agent-exec”)
In the meantime, try these workarounds:
Workaround 1: Legacy Terminal Tool
Settings > Agent > Legacy Terminal Tool: turn it on
Restart Cursor
Workaround 2: Set an explicit shell
Settings > Terminal > Integrated > Default Profile: Windows
Pick PowerShell (not “null” or “default”)
Restart Cursor
Workaround 3: Check PATH
In a normal PowerShell (not inside Cursor), run:
where.exe git
where.exe mvn
$env:PATH
If git or mvn aren’t found, you’ll need to add them to PATH.
In a similar thread, one user temporarily fixed it with a PowerShell profile workaround. If you want, here’s the thread with details: Terminal problems when used by agent. The issue came back though, so it’s not a full fix.
Please share your DevTools logs and we’ll have a better idea what’s breaking.
Thanks for the info. About point 2: Settings > Terminal isn’t Cursor Settings, it’s VS Code settings. Try this:
Press Ctrl + ,
In the search box, type “default profile windows”
Find Terminal > Integrated > Default Profile: Windows
Select PowerShell (not “null” and not “default”)
Restart Cursor
About the DevTools logs: we need the errors that show up when the agent tries to run a command:
Go to Help > Toggle Developer Tools
In the Console tab, clear logs (right click > Clear console)
Ask the agent to run git status or mvn test
Copy the logs that include “path”, “ENOENT”, or “cursor-agent-exec”
In another thread, a user had the exact same symptom and the logs showed: ERR_INVALID_ARG_TYPE: The "path" argument must be of type string. Received undefined. If you have the same thing, it’s a known Windows bug in 2.4.21 to 2.4.27.