fix(exec): use empty default and os.pathsep for cross-platform

This commit is contained in:
aiguozhi123456
2026-02-24 12:13:52 +00:00
parent abcce1e1db
commit 7be278517e
2 changed files with 3 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ class ExecTool(Tool):
deny_patterns: list[str] | None = None,
allow_patterns: list[str] | None = None,
restrict_to_workspace: bool = False,
path_append: str = "/usr/sbin:/usr/local/sbin",
path_append: str = "",
):
self.timeout = timeout
self.working_dir = working_dir
@@ -71,7 +71,7 @@ class ExecTool(Tool):
env = os.environ.copy()
if self.path_append:
env["PATH"] = env.get("PATH", "") + ":" + self.path_append
env["PATH"] = env.get("PATH", "") + os.pathsep + self.path_append
try:
process = await asyncio.create_subprocess_shell(