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

View File

@@ -252,7 +252,7 @@ class ExecToolConfig(Base):
"""Shell exec tool configuration.""" """Shell exec tool configuration."""
timeout: int = 60 timeout: int = 60
path_append: str = "/usr/sbin:/usr/local/sbin" path_append: str = ""
class MCPServerConfig(Base): class MCPServerConfig(Base):