Skip to content

[Bug]: [Bug] Windows 11: Terminal execution fails (exit 126), File Access broken, and Doctor crash on GBK locale #18637

@wzgrx

Description

@wzgrx

I installed Hermes Agent using the official script on a clean Windows 11 system. I am encountering three critical bugs that make the agent unusable out-of-the-box:

1. Terminal Execution Fails (Exit Code 126)                                                                                           
Issue: The terminal toolset is enabled and configured as local, but NO commands can be executed. Every command (even simple ones like echo hello or pwd) fails with exit_code 126.                                                                                              
Observation: This happens on a fresh install where Git Bash/WSL might not be the primary shell. Hermes seems to rely on bash being available in the path but doesn't fallback to PowerShell/CMD or give a clear error.                                                          
                                                                                                                                      
2. File Access Tools Cannot Read Files                                                                                                
Issue: The read_file tool fails to read existing files.                                                                               
Example: Trying to read a valid file at E:\AI\hermes\config.yaml results in a "File not found" error, even though the file exists and is readable by the system.                                                                                                                
Impact: The agent is effectively blind and cannot inspect the codebase or configuration.                                              
                                                                                                                                      
3. hermes doctor Crash on Windows Chinese Locale                                                                                      
Issue: Running hermes doctor crashes immediately when trying to read the .env file.                                                   
Error Log:                                                                                                                            
text                                                                                                                                  
UnicodeDecodeError: 'gbk' codec can't decode byte 0x94 in position 661: illegal multibyte sequence                                    
  File "...\hermes_cli\doctor.py", line 267, in run_doctor                                                                            
    content = env_path.read_text()                                                                                                    
                                                                                                                                      
Cause: Python on Windows uses the system locale (GBK for Chinese Windows) by default. Since .env files are UTF-8, read_text() fails.  
                                                                                                                                      
Environment                                                                                                                           
- OS: Windows 11 (Chinese Edition, GBK default encoding)                                                                              
- Python: 3.11.15                                                                                                                     
- Hermes Version: [Insert Version here]                                                                                               
- Shell: PowerShell / CMD                                                                                                             
                                                                                                                                      
Expected Behavior                                                                                                                     
1. Terminal should work on Windows (fallback to cmd.exe or powershell.exe if bash is missing).                                        
2. File tools should handle Windows paths (backslashes) correctly.                                                                    
3. hermes doctor should explicitly open files as UTF-8.  

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High — major feature broken, no workaroundbackend/localLocal shell executiontool/fileFile tools (read, write, patch, search)tool/terminalTerminal execution and process managementtype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions