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

@@ -97,16 +97,6 @@ class TestDispatch:
assert loop.tools.get("exec") is None
def test_exec_tool_receives_custom_deny_patterns(self):
from nanobot.agent.tools.shell import ExecTool
from nanobot.config.schema import ExecToolConfig
loop, _bus = _make_loop(exec_config=ExecToolConfig(deny_patterns=[r"\becho\b"]))
tool = loop.tools.get("exec")
assert isinstance(tool, ExecTool)
assert tool.deny_patterns == [r"\becho\b"]
@pytest.mark.asyncio
async def test_dispatch_processes_and_publishes(self):
from nanobot.bus.events import InboundMessage, OutboundMessage

View File

@@ -134,12 +134,6 @@ def test_exec_guard_blocks_quoted_home_path_outside_workspace(tmp_path) -> None:
assert error == "Error: Command blocked by safety guard (path outside working dir)"
def test_exec_empty_deny_patterns_override_defaults() -> None:
tool = ExecTool(deny_patterns=[])
error = tool._guard_command("rm -rf /tmp/demo", "/tmp")
assert error is None
# --- cast_params tests ---