This appears to be similar to this issue. If you interrogate the agent, they have no idea why the command returned too soon and will sometimes blame the user for the premature exit. Turns out there is another model or system that is monitoring terminal commands and reporting when they are “done”. But depending on which shell you are using or what other things are happening in that terminal, the command exit detection can fire prematurely or not at all. I find that if the agent is running any command that takes more than 5 seconds, there’s a very high chance the IDE will ^C and kill it. If it does let the command complete, it will often just sit there until the connection to the agent service times out.
The terminal command tool needs some very important fixes.