This is a known bug affecting the agent’s shell tool on Windows. The agent uses a different terminal execution path than the integrated terminal, and on Windows it can fail to detect when commands have finished, producing the hang you’re seeing.
Our engineering team is actively investigating. No reliable workaround exists at this time, though one thing you could try as a long shot: switch the default terminal profile to Command Prompt (cmd.exe) instead of PowerShell, then retry the agent.
Your finding that 3.5.38 works while 3.6.31 doesn’t is helpful – we’ll use that to narrow down the regression. I’m merging this into an existing thread where we’re consolidating reports of this issue. Updates will be posted there once a fix ships.