mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-09 13:21:42 +00:00
fix(gateway): add system dirs to PATH for UV Python compatibility
UV's bundled Python ships a minimal PATH that excludes /bin and /usr/bin, causing launchctl/systemctl subprocess calls to fail with FileNotFoundError. Fixes #3849
This commit is contained in:
parent
708b57e009
commit
1b7853d7bc
1 changed files with 8 additions and 0 deletions
|
|
@ -12,6 +12,14 @@ import shlex
|
|||
import shutil
|
||||
import signal
|
||||
import subprocess
|
||||
|
||||
# Ensure /bin and /usr/bin are on PATH so launchctl/systemctl are discoverable
|
||||
# when running under UV's bundled Python which ships a minimal PATH.
|
||||
_sys_dirs = {"/bin", "/usr/bin", "/usr/sbin", "/sbin"}
|
||||
_path_dirs = set(os.environ.get("PATH", "").split(os.pathsep))
|
||||
_missing = _sys_dirs - _path_dirs
|
||||
if _missing:
|
||||
os.environ["PATH"] = os.environ.get("PATH", "") + os.pathsep + os.pathsep.join(sorted(_missing))
|
||||
import sys
|
||||
import textwrap
|
||||
import time
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue