refactor(tools): keep exec enable without configurable deny patterns

Made-with: Cursor
This commit is contained in:
Xubin Ren
2026-03-20 17:46:08 +00:00
parent dc1aeeaf8b
commit 1c39a4d311
6 changed files with 1 additions and 20 deletions

View File

@@ -126,7 +126,6 @@ class AgentLoop:
timeout=self.exec_config.timeout,
restrict_to_workspace=self.restrict_to_workspace,
path_append=self.exec_config.path_append,
deny_patterns=self.exec_config.deny_patterns,
))
self.tools.register(WebSearchTool(config=self.web_search_config, proxy=self.web_proxy))
self.tools.register(WebFetchTool(proxy=self.web_proxy))

View File

@@ -23,7 +23,7 @@ class ExecTool(Tool):
):
self.timeout = timeout
self.working_dir = working_dir
self.deny_patterns = deny_patterns if deny_patterns is not None else [
self.deny_patterns = deny_patterns or [
r"\brm\s+-[rf]{1,2}\b", # rm -r, rm -rf, rm -fr
r"\bdel\s+/[fq]\b", # del /f, del /q
r"\brmdir\s+/s\b", # rmdir /s

View File

@@ -121,7 +121,6 @@ class ExecToolConfig(Base):
enable: bool = True
timeout: int = 60
path_append: str = ""
deny_patterns: list[str] | None = None
class MCPServerConfig(Base):
"""MCP server connection configuration (stdio or HTTP)."""