OpenHands / OpenHands/software-agent-sdk
[Bug]: Windows PowerShell detection fails when a slow user profile (e.g. conda init) exceeds the probe timeout
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.1k
- Forks
- 539
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 137
Description
Bug Description
On Windows, the terminal tool probes for PowerShell by launching it once in
factory._get_powershell_command. The probe does not pass -NoProfile, so
it loads the user's PowerShell profile. A profile that runs e.g. conda
initialization can take several seconds to start, which exceeds the probe's 5s
timeout, raising subprocess.TimeoutExpired. The candidate is then skipped,
detection returns None, and the agent fails even though PowerShell is
installed and works.
Notably WindowsTerminal itself already launches the shell with
-NoLogo -NoProfile, so the real terminal would have worked — only the
availability probe was affected.
Expected Behavior
PowerShell availability detection should not depend on the contents or speed of
the user's PowerShell profile. If PowerShell is installed, it should be
detected and the agent's shell commands should run.
Actual Behavior
Starting a chat with a PowerShell-backed profile fails with:
500 Internal Server Error
"PowerShell is not available on this system"
Reproduce/verify with the SDK test suite:
uv run pytest tests/tools/terminal/test_powershell_detection.py
Measured on an affected machine (profile runs conda init):
with profile : powershell.exe ... -> 5.49s (exceeds the 5s probe timeout)
-NoProfile : powershell.exe ... -> 1.00s
Steps to Reproduce
- On Windows, configure a PowerShell profile that runs a slow initializer
(e.g.condainit) so a coldpowershell.exestart takes > 5s. - Start the agent-server and begin a new chat with a PowerShell-backed LLM
profile. - The first shell command fails with "PowerShell is not available on this
system" even though PowerShell is installed.
Acceptance Criteria
- The PowerShell availability probe launches with
-NoProfile(and
-NoLogo), so a slow user profile no longer causes detection to fail. - A probe timeout is treated as "unavailable" without crashing.
-
uv run pytest tests/tools/terminal/test_powershell_detection.pypasses.
Installation Method
pip install -e .
Operating System
Windows
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at factory._get_powershell_command and compare its probe arguments with WindowsTerminal's -NoLogo -NoProfile launch. Update the availability probe so profile startup cannot cause detection failure, while treating a timeout as unavailable. Run uv run pytest tests/tools/terminal/test_powershell_detection.py and verify the listed acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- powershell, python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100