-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Description
Bug: tools.exec.pathPrepend replaces PATH entirely instead of prepending
Platform: Windows 10 (22H2), node v24.6.0, OpenClaw v2026.2.23 (b817600)
Shell: PowerShell
Expected behaviour
Setting tools.exec.pathPrepend should prepend the specified directories to the existing system PATH, making those directories available alongside all existing PATH entries.
Actual behaviour
The specified directories replace the entire PATH. After applying this config and restarting, the exec shell PATH contains only the prepended value — all standard system directories are gone.
Steps to reproduce
- Apply config:
tools.exec.pathPrepend: ["C:\\Users\\username\\AppData\\Roaming\\npm"] - Restart gateway
- Run any exec command:
powershell Get-Date
Result:
powershell: The term 'powershell' is not recognized as the name of a cmdlet, function, script file, or operable program.
Verified by running echo $env:PATH inside exec — output was only C:\Users\arvid\AppData\Roaming\npm. All of C:\Windows\System32, C:\Windows, and every other system directory were absent.
Impact
Setting this config key renders the exec tool completely non-functional. powershell, where.exe, gh, and all other system commands disappear from PATH. No exec commands can run at all. The only recovery is to remove the key from openclaw.json directly and manually restart the gateway.
Workaround
Do not use tools.exec.pathPrepend. Reference executables via full absolute path when needed (e.g. C:\Users\username\AppData\Roaming\npm\openclaw.cmd).